I get an error every time I try to calculate a field on a hosted feature layer after it processes for 3 hours. I haven't been able to successfully get this tool to work.
I've been having the same issue with another geoprocessing tool and a hosted feature layer in ArcGIS Online, troubleshooting it for many months with Esri Technical Support. If you're not running it as a geoprocessing tool from the Toolbox, try that, and then see if there's an Enable Undo toggle at the bottom that you can enable. That seems to make some operations against online data more robust, but you need to save the calculations after you run them in that configuration. You may be successful, or you could get a 504 server timeout.