When trading with a villager (Cartographer) to get a woodland explorer/ocean explorer map it can occasionally give you a map that's outside the world border.
Steps to Reproduce:
Teleport to one corner of the world border:
/tp @p 29999999 ~ 29999999 /tp @p -29999999 ~ 29999999 /tp @p -29999999 ~ -29999999 /tp @p 29999999 ~ -29999999
Spawn a villager with a cartography table nearby
Level it up so that it sells an explorer map
Check the map
If you are unable to reproduce the issue with any of the maps, try moving to a different corner of the border, and repeat steps.
Expected:
The map would stay inside the border, because the player cannot move/explore outside of it, making the map redundant.
Observed:
The map can lead outside of the border, disallowing the player to explore outside of it.
Can confirm in 1.17.1.