As the card sheet is closed due to being discarded, the save on close attempts to save the document. This causes an error as the document has already been removed.
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be resolved. The issue was opened by zeel01 and has received 0 comments.