The Refer verb is only allowed on SIP call legs, e.g. you can refer an incoming SIP call that originate from SIP infrastructure or an outbound call to a SIP destination. Calls to or from other destinations, such as a phone number or Twilio Client cannot be referred.
Possible Causes
Your application attempted to invoke the Refer verb on a PSTN or Twilio Client call leg.
Possible Solutions
For more information on understanding what does and does not constitute a SIP call leg, please see Understanding SIP Call Legs.
While invoking Refer on a SIP leg is unique in that it removes Twilio from the call path, the effect of transferring a call to another party can be accomplished on all leg types by simply using the Dial verb to call the other party.