You will need to give me more than a 404 error code as that means nothing apart from the page was not found which obviously doesn’t make sense as the admin page posts to itself.
There shouldn’t be a 404 error unless you somehow submitted the page to a non existent page.
Are you sure it wasn’t a 500 server error? OR maybe a timeout error – which might happen if you have a large number of posts/tags and you haven’t set your server up to handle long page load times.
I do change the PHP code to have a timeout of “unlimited” with
set_time_limit(0);
But if your webserver has been set to time out after 30 seconds then it won’t matter what the code does as I have found out before. So you might need to change your webserver settings to allow for unlimited page load times during any re-tagging process (and then change it back afterwards) as its not advisable to leave it like that.
That is the only thing I can think of unless you give me a proper error message which would only happen with a 500 status code not 404.