Putting the id in the filename will not help with matching, it needs to be in the folder name if you want to use the ids for matching. Basically like this …
plex@dokuro:/data/Personal/Scripts$ ls '/data/MediaServer/14b-Movies/Movies/The Batman (2022) {tmdb-414906}'
fanart.jpg poster.jpg 'The Batman (2022).mp4'
plex@dokuro:/data/Personal/Scripts$
So /data/MediaServer/14b-Movies/Movies is my top level movie library and The Batman (2022) {tmdb-414906} is the movie folder itself containing the movie media files.
I’m using tmdb ids but its the same for imdb, just change it to match what you are doing. Also, as @Divideby0 has said you will likely need to plex dance it as bad information is now in your db which needs to be removed.