Geany is nearly 20 years old and works on the presumption from those times that applications will be properly closed before logging out or shutting down. This has not been changed since then.
It is good that the presumption is removed by more modern IDEs like Vscode, as well as other apps like browsers (and as all those use the same code base, they all inherit it) but until "somebody(s)" make the relevant changes to Geany the workaround is simply to close it before logging out/shutting down.