I guess you @dbirch are answering to @somail who used a rollback instead of my approach, similar to the post here Playback error: An error occurred loading items to play - Plex Media Server - Plex Forum.
While I agree that not anybody should blindly follow ChatGPT I think my approach is still fine and maybe safer than just straight use a shell script which messes with the tables.
But I thought I should leave the information here, so anybody can decide what to do. And worst case, there is a backup of your database.