This bug is monstrous, so I thought it has probably been reported already, but I searched the forum and could not find anything like it. Apologies if there is something and I missed it.
The bug happens with all plugins disabled, and without sync. It also happens in the sandbox vault. I am using Windows 10.
Steps to reproduce
Create note /posts/post/index.md
Create subdirectory /posts/post/images
Copy some image into the subdirectory, say /posts/post/images/image.png
Edit index.md and type in the following link: 
The image should appear in the note.
Now rename image.png to image1.png
Did you follow the troubleshooting guide? [Y/N] Yes, happens in the sandbox.
Expected result
I expect the link to the image to be updated as follows: 
Also, if something goes wrong, and the link for some reason becomes broken, then I expect obsidian to stop showing me the image in the note. When obsidian keeps showing me an image whose link is invalid, it is trolling me; it is making mistakes much easier to happen, and troubleshooting a lot harder.
Actual result
Obsidian tries to update the link, but in so doing it removes the subdirectory part from the link, so it becomes , which is broken.
Furthermore, obsidian keeps showing me the file in the note, so it is trolling me.
Environment
SYSTEM INFO:
Obsidian version: v1.9.12
Installer version: v1.9.12
Operating system: Windows 10 Pro 10.0.19045
Login status: not logged in
Language: en
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on
RECOMMENDATIONS:
none
Additional information
The same problem happens if you rename images to images1, or post to post1.