The spell text just says
You create a bonfire on ground that you can see within range. Until the spell ends, the magic bonfire fills a 5-foot cube.
Duration is 1 minute, with concentration.
There are at least 4 ways to interpret this in the case ground disappears:
Bonfire floats in the air. There's nothing which says it must stay on ground, so there's no such requirement. The general concensus is that fire spells work even underwater (magic...) so why not floating in the air
Bonfire is on ground. If ground moves, bonfire moves.
Having the original ground, seen by the caster when spell was cast, is requirement for the spell to work. If ground changes, spell ends.
Instead of ending (previous option) spell could be just suppressed. If ground returns within duration, bonfire flares up again (assuming caster maintained concentration). This mechanic would be consistent eg. with anti-magic field.
It's up to the DM. 1st option is maybe most direct reading of the rule, the bonfire will just be there for a minute. 2nd option is for tables which want to allow complex shenanigans and general wackiness by using things in unexpected ways. 3rd option is safest for balance and easiest for bookkeeping, but also most boring. 4th option would be my choice as a DM, it sounds like a bit of everything.