Magic in the Lastlands, like many other things, is slightly different than the norm. The vast majority of magic works absolutely fine, with no differences for how spells work in the Lastlands, on Toril, or on one of the Planes. However, there are still some differences.
First, spells that require direct intervention or information from a deity do not function. This includes spells such as Augury or Divination, for example. Arcane spells that may invoke the direct aid of a deity, such as Planar Ally, fail if the caster calls specifically upon a god or goddess as part of the spell.
In addition, any spell that involved travel to one of the Inner or Outer Planes does not function. Spells like Plane Shift have limited functionality – the caster can use them to travel to Shadowfell or the Feywild and, sometimes, to the Astral and Etherial planes. No spell has yet been shown to allow travelers to enter any of the other Planes beyond those four. Whether travel to the Inner or Outer Planes is possible from the four reachable Planes is only known to those powerful mages who could accomplish such travel.
Travel from the Outer and Inner Planes to the Lastlands – for example summoning of Planar entities- is possible, however. All summoning spells seem to function normally and those entities presumably have no trouble returning home when the spell has expired.
What has caused this strange phenomenon and how to get around it are frequent topics of discussion in arcane circles. A clear, unequivocal answer has not been found, though every magic user has his or her own opinion.