The Stack Snippets editor includes a "Tidy" button. This button uses a outdated version of js-beautify which does not include support for syntax changes in ECMAScript 2020 and newer. Running it with code that uses such syntax can result in the code being broken and producing syntax errors. This has been reported on MSE and MSO several times over the last four years, such as here, with requests to update js-beautify to fix it, such as here, but it hasn't been fixed. There are probably going to be more syntax changes in the future, so this will continue to get more broken unless it's regularly updated.
Since that doesn't seem likely, I suggest the easier solution of just removing it instead.
In theory, a code formatting capability could be useful for any code block on Stack Overflow, but one was never implemented and I don't think there's ever been much demand for it. There's no strong reason that Stack Snippets needs it when the rest of the site does without.
As currently implemented, the feature is arguably harmful, since it can cause otherwise-valid code to become broken, perhaps without the author realizing. (I generally assume that formatting my code doesn't affect behavior, so I wouldn't necessarily feel a need to re-test after formatting it.)