This issue has been present on previous versions however a spectate command was not present before 1.15 so it only became an official issue now that 1.15 was released.
When you select an entity to spectate that's far away, for example with the following command.
This will only teleport you to the entity. The game still thinks you are spectating this entity however! If you sneak to exit spectating mode it will teleport you back to the entity because the game thinks you're first person spectating the entity in question even when you're not.
On a server the effect is even worse as it triggers multiple "Moved too quickly" warnings then teleports the client to the entity causing a huge lag spike.
This does not occur on nearby/loaded entities.