Most likely, the location of the spell is used
There are no RAW statements about failure when casting spells, except under spells that take longer casting times:
Some spells (including spells used as rituals) require more time to be cast: minutes or even hours. When you cast a spell with a longer casting time than an action or a reaction, you must spend your action every turn to cast it and you must maintain your focus while you do it (see "Concentration" above). -Dessous). If your concentration is broken, the spell fails, but you do not spend a slot. If you want to try to revive the spell, you must start again.
However, teleportation is an instant spell and your concentration is not broken – you cast the spell.
We therefore examine two other spells that can block magic / travel: the invulnerability globe and the antimagic field.
Globe of Invulnerability states:
No spell below or below 5 launched from outside the barrier can affect creatures or items it contains, even if the spell is cast using a higher level spell slot. Such a spell can target creatures and objects in the barrier, but the spell has no effect on them.
So one spell prevents the effects of another. This implies that the spell is cast and the slot is used, but it has no effect.
The Antimagic field is closer and calls the teleportation:
Spells and other magical effects, except those created by an artifact or deity, are removed from the sphere and can not be protruded. A slot used to cast a deleted spell is consumed. When an effect is deleted, it does not work, but the time spent in deletion is counted in its duration.
Magical journey. Teleportation and planar journeys do not work in the sphere, whether this is the destination or the starting point of this magical journey.
Much closer to what is happening in the Forbidden spell. It removes the teleportation magic, but does not prevent the caster from trying to experiment with a spell extension.