This seems to indicate JSON problems. I would suspect that you’ve globally overridden the settings for Newtonsoft JSON and that’s now giving you problems.
Attach a backup of your database from this site to this clean install
Upgrade this clean install, attached to your database
That should work, if it still gives you this error then you have some more obscure problem on your machine.
After the upgrade succeeds, you can attach your backed up database to your current website again, which you already moved to 13.8.1. With the database also being on 13.8.1 you wouldn’t see the upgrade installer and hence not this error.