Change the XML document information entry for the title and it will fix the name request from the krita API of an active documents name. in this case both requests will now offer the same result. In this case both are returning the name “ghost”.
So each time you save a document under a new name/version you have to change the XML title name to the same name to actually reflect those changes all around for the APIs concern because it will remain the same file even if you save as with a new name. What matters is the name of creation.
I know it is not useful for everyone, but I thought I should share if someone happens to have the same issue I had. why this miss match happens when saving happens I don’t know.