Hi Alex,
this error is not very specific
If this error occurs I try updating manually.
On the update site under the normal update button there is a button with Upload and install (or similar) oder "Hochladen und installieren" auf deutsch.
Before you use this go to joomla.org and download the current update package (not the full update only the upgrade package).
With version 4.2.1 it's
https://downloads.joomla.org/cms/joomla4/4-2-1 - for example the Joomla! 4.2.1 Upgrade Package (.zip) - you have to scroll down a bit to find it.
Then go to your upload area on your site and click that upload and install button.
Then choose the file and then you must re-enter your login data. After that the update should run.
For me this helps in most of the cases. I haven't had the time to choose the error reason, maybe someone else knows it
Hope this helps.
Regards
Oliver