In a project with a dune-project that says (formatting (enabled_for ocaml reason)), running dune format-dune-file will still format the dune file despite the formatting stanza saying that it shouldn't happen.
The problem mostly appears when using ocamllsp as dune format-dune-file is a low level command that one usually doesn't call directly.
dune 2.5