Comprehensive Rules
307.5a
Similarly, if an effect checks to see if a spell was cast âany time a sorcery couldnât have been cast,â itâs checking only whether the spellâs controller cast it without having priority, during a phase other than their main phase, or while another object was on the stack.