DID Fragment
The portion of a DID reference that follows the first hash sign character ("#"). A DID fragment uses the same syntax as a URI fragment. See section 5.5. Note that a DID fragment MUST immediately follow a DID. If a DID reference includes a DID path followed by a fragment, that fragment is NOT a DID fragment.
RE: "Note that a DID fragment MUST immediately follow a DID." Not true.
The first hash sign character ("#"), if present, must immediately follow the the DID. The DID Fragment, if present, must immediately follow the first hash sign character ("#").
In https://w3c-ccg.github.io/did-spec/#terminology, it states...
The first hash sign character ("#"), if present, must immediately follow the the DID. The DID Fragment, if present, must immediately follow the first hash sign character ("#").