"The inviteToken is passed as input."
How are you passing this value to the custom policy?
The REST API requires this as input. Since this is not given a value anywhere in the custom policy, this may explain the error?