Rejecting sometimes corrupts the code

Sometimes accepting an edit messes up the file so I reject it. Then it corrupts it some more. Maybe I can understand the corruption on applying a change, but rejecting it should never go wrong; it’s an undo away!

Cody 7.82 on IntelliJ 2024.3.5