Cursor always overwrites the currently active file incorrectly

In agent mode, once changes involving multiple files are made, the content of other files incorrectly overwrites the currently active file. Has anyone encountered this issue?