With c2b7d78 flatpak support was added to cosmic_config.
However the way it is implemented now does not work if XDG_CONFIG_HOME is not set on the host and .config/cosmic does not exist on the host.
When the application requests --filesystem=xdg-config/cosmic:rw the $XDG_CONFIG_HOME/cosmic folder is only mounted in if it exists.
When XDG_CONFIG_HOME is not set on the host, flatpak does not set HOST_XDG_CONFIG_HOME in the Sandbox and cosmic_config uses $HOME/.config/cosmic in the sandbox as a fallback. But this directory is cleared after the flatpak exits.
Proposed solution
Fallback to $XDG_CONFIG_HOME/cosmic if the app is sandboxed and $HOME/.config/cosmic does not exist