If an effect allows an opponent to cast spells any time they could cast an instant (for example, if your opponent controls Teferi, Mage of Zhalfir), the restriction of Teferi’s last ability takes precedence over that permission.