Site Collection Administration permission lost – strange issue

Strange thing that happened to my account. I am Site Coll Admin on all web sites on an on prem server, but one day the “Site Collection Administrators” and “Site Collection Features” links were gone from two of the sites (in Swedish):

First thing I checked is in Central Administration and “Change Site Collection Administrators”
I was listed on all sites

Then I logged in as the farm administrator and could access the “Site Collection Administrator” link. One site was empty of accounts and the other had only one other account listed. Strange, since I have never changed these values.
I simply added back the accounts and on one of the sites it worked fine. But, on the other I got this message when I tried to add back my own account:

Parametern loginName får inte vara tom eller längre än 251 tecken
Translated:  The parameter loginName cannot be empty or bigger than 251 characters

Very strange, I have never seen this error before. But this made me remember that when I tried to add one of our AD groups, I got a message that the name was too long. So there is a limit on how long account or group names you can use in SharePoint. Somehow these entries must have been removed – in an update? Or when I ran the powershell command that clears the logon cache? I have no idea.

I tried a few times more, and then boom – the accounts just went through and now all three accounts were added.

I have no code running on the sites, the only customization is in my master page but no big at all. I have not made any changes in the web.config files on these two sites.

The only change I can think of is that the ASP.NET feature was installed by another administrator on the server, we will remove it again because it generates other errors in Event Viewer. Maybe something happened when that was installed.

Any ideas?