In 1.21.8 and below versions when walking on the ground then switching to spectator and flying off the ground then switching back to creative gamemode would make you stay in the air. But a recent snapshot changed this so now it makes you fall out of the sky.
see clip. https://www.twitch.tv/raysworks/clip/DreamyZealousGrasshopperUncleNox-c2KXPedEuiMxQD1B
Can confirm.