flatpak is designed for gui apps, registering a desktop icon and so on.
To really make use of it we'd need at least a small gui app that then
lets you start/stop the jupyter server and/or launch browser windows.
If you just want to run Sage then there is already a one-liner
podman / docker command to download and run it (and with
podman any user account can do it, no permission setup needed):podman run -it sagemath/sagemath