I can't quite spot the issue within the token, but it could be something to do with the way that you have defined the restriction in the ContentKeyPolicyTokenRestriction object.
Make sure that your issuer and audience match what you passed into the JWT token. If the sample worked for you, it might be the difference. Otherwise, as noted on Stack Overflow, the other common issue for the 0x20500006 error in the player is not using https on the player page and the URL. But I don't think that is your issue here.
let restriction: ContentKeyPolicyTokenRestriction = {
odataType: "#Microsoft.Media.ContentKeyPolicyTokenRestriction",
issuer: issuer,
audience: audience,
primaryVerificationKey: primaryKey,
restrictionTokenType: "Jwt",
alternateVerificationKeys: undefined,
requiredClaims: requiredClaims
}
Check through all pats that set the Content Key Policy token restriction up, and make sure that it matches your required claims passed into the JWT token.