A recommendation by the IETF (internet standards body) is using the application/problem+json mediatype. See https://datatracker.ietf.org/doc/html/rfc7807 for that.
Notable is that they don't use random numbers, they use strings (specifically uris) to identify errors.
This is a subjective question, but even if you don't use their format, I'd argue that username-not-provided is better in almost every way to 100001.