Reclaim root access - High Sierra
While trying to enable the root user, I got the error

dsenableroot:: ***Failed to enable root user.


So I looked into that and found out thanks to an answer to Why would dsenableroot NOT work on a 10.7.5 OSX Server? that I had to check my root user in the file /private/var/db/dslocal/nodes/Default/users/root.plist.

Sadly, the file was missing. And this was the root cause of the problem: I didn't had a root user. After copying it from another macOS installation, 


sudo started working again
id did no longer show the membership to nogroup
the command dscl . read /Users/root said that it finally found a user
and I was able to find root in the directory browser