I am trying to create an access token with a custom claim with a special character in the claim name(ex: user_email) but I see the generated token is not taking up the claim.
but I was successful with a special character(-), is this the expected behavior? character _(underscore) is not allowed?
Yes! Appending custom claims with special characters like an underscore should work fine.
I did notice in your Action script that you are not using a namespaced URI to append your custom claims. This could lead to a scenario as you observed, where this claim is reserved and colliding an the existing claim. This causes your custom claim not to be added to your tokens.