I think I see the problem: your plugin renames things without going through Obsidian’s auto-renaming. I wrote a plugin today that safely handles link moves, and it requires a lot more work to not corrupt the data.
My suggestion would be to not do the auto-renaming, but instead allow users to just manually rename if they need to, as that will then update all links.