The Dominate Beast spell will end
There was a (somewhat confusing) sage advice tweet about this topic. Jeremy Crawford stated (emphasis mine):
In #DnD, the exceptional trumps the general. (No longer being a valid target trumps condition carryover.)
When a wildshaped Druid reverts to their normal form, we have those two conditions: the target changing type, and condition (charmed) carrying over. The target changing type makes it an invalid target which, as confirmed in the sage advice tweet, trumps the charmed condition carrying over.
Since the spell would no longer has a valid target once the druid changes back, the spell will end.
What about the other two Dominate X spells?
For completeness, let’s run through the two other dominate spells.
Dominate Person requires a humanoid target. All official PC races are humanoid, so while the druid is in its normal form it can be targeted and charmed by a Dominate Person spell. If the druid wildshapes into a beast, its type changes to match that beast. So, the druid is no longer a humanoid, the target of Dominate Person is invalid, and the spell ends. In this way, it works in reverse of the Dominate Beast spell.
Dominate Monster works on any creature. Whether in beast form, humanoid form, or even in a Circle of the Moon druid’s elemental form, the druid is still a creature. Thus, even going in and out of wild shape won’t make the druid an invalid target. Since the target is still valid, the Dominate Monster spell will still have full effect, even if the druid wild shapes.