Hello. To solve, what I did was momentarily deactivate my theme, and installed the wordpress twenty twenty theme. I disabled any unnecessary plugins and started the process and it worked. It takes a long time and uses a lot of memory, so I don’t recommend doing anything while the process is finishing. You can see if it’s working by checking the uploads folder on the server and seeing if the images are being updated.
Another thing is that I did it with groups of 10 posts. Not with all of them at the same time.