dnd 5e – What happens when a Scrying target teleports away, or moves through a portal?

As the title says, I am unsure on the RAW or RAI of what would happen if a target who is being scried upon were to use the Teleport spell, or some other instant travel spell, for intraplanar only travel.

The relevant parts of Scrying:

You can see and hear a particular creature you choose that is on the same plane of existence as you.

On a failed save, the spell creates an Invisible sensor within 10 feet of the target.

The sensor moves with the target, remaining within 10 feet of it for the Duration.

If the target were to travel outside the plane, then they would cease being a valid target for the spell. However, if the target merely travels within the current plane, does the sensor teleport alongside them? Or does the spell simply end? Or some other effect I haven’t considered?

And is it different for spells where the target physically moves through a portal, vs just disappearing and reappearing? e.g. Arcane Gate vs Dimension Door.