Perhaps, after using megaflare (which he is clearly charging at the end -- you can see it right after Louisoix's staff breaks), Bahamut is exhausted enough so that he can be once again imprisoned in the giant red moon known as Dalamud. This is just my personal opinion, but Dalamud looks very 'egg-like' when it breaks open. The edges of it are also spiny (what was that blade that fell to the ground about?). It seems as though it is a shell that bursts open, revealing Bahamut. They try to recreate this, but fail. If Louisoix and the others are mere mortal incarnations of the deities, then the deities themselves can still act even if their mortal selves are gone... perhaps they will be even more powerful... Or, as I said above, perhaps Bahamut will be so exhausted after Megaflare that he can once again be imprisoned. It may have even been Megaflare that prevented the prison spell/ritual from completing in the first place.