The formatter in SQLDev formats the code even if errors are found. The result is sometimes ok and in other cases it is fatal. Granted, you can always press Ctrl-Z to undo the formatting. But to do that, you have to recognize that something has gone wrong. With larger files, you may not see it right away. Undoing the formatting result may not be as easy later.
A case of fatal formatting result is documented here: https://github.com/Trivadis/plsql-formatter-settings/issues/98 (reproducible with default formatter settings).
Why not provide an additional option? Something like "Format code on error? (Yes/No)". You can keep the current default of "Yes".
There are for sure some developers (like me) who would like to change the default to "No".