I came across this issue last night. When decommissioning a whole stack of ships (possibly only random event ships) the ship maintenance cost remains.
I had a lucky event that said I found a Precursor Corvette class ship. That actually turned out to be about 100 ships in many different stacks. Well, I suddenly had more ships than I could maintain financially so I tried to decommission a whole stack at a time by selecting the stack and going ->Details->Decommission. It sold part of the ship costs back to me but my ship maintenance remained the same and I continued to lose money. I had to eventually disband each stack and delete each ship individually. There is a workaround sure, but it seems that this behavior was not intended. I won't be able to test whether it happens with any ship stack or if it's just randomly generated ships until tonight. Has anyone else had this issue?
I wonder if eventually there will be a way control individual ships in a stack (upgrades and deletions) without disbanding and moving them off each other.