The courts have ruled on many occasions that Democrats don’t have to follow election laws if doing so places them at risk of losing.
Weird deal, here, though. It’s not that they have a replacement DEMOCRAT to put on the ballot, but are withdrawing so someone NOT from their party can win.
But, yeah, all you pessimists are probably correct - some judge will rule in favor of the democRats regardless.