The problem here is Plex. It “helpfully” automatically renames the file it’s playing over DLNA—I think it adds the year to the end of the video?—which means your script’s name won’t match so it won’t sync.
Say you have “example.mp4” and your script is called “example.funscript”, Plex automatically does something weird to the served filename. I think it takes the date you added the video to your library (the ‘Originally Available’ metadata field) and adds this to the end of the title it’s playing, so it in effect becomes “example 2022.mp4” or something like that.
The only way I could figure out how to get Plex to work with scripts was to go into the Plex interface and manually edit each video’s metadata, deleting/blanking the ‘Originally Available’ metadata field for each one and saving it. That will fix it, but if you’ve got lots of videos in your library then this isn’t really a practical workaround as you’ll have to edit the metadata for every one. I’d recommend using something that doesn’t suck instead, like XBVR, if you have a larger library.