/locate will only locate a structure within only 5000 blocks any more it won't, and doesn't work for mansions.
Linked issues
Comments


I don't see how you can come up with this "5000 blocks" figure, unless you have some code from the game that explicitly says this (although at that point I would think it would be intentional).

Duplicate of MC-126244.

First issue: The `locate` command is used to locate the nearest structure, the game doesn't say: "No structure was found in a 5000 blocks range".
Second issue: Duplicate of MC-125090.
However, you should read the summary because you can't submit two issues per report! Also, it's not a duplicate of MC-126244 as CreeperMagnet_ said because it reports a different issue.

@unknown, it's very clearly the same report, or caused by the same behavior. This is because, as seen in MC-126244, it can fail, reading "could not find that structure nearby". The second issue is also a duplicate of MC-126244, as loading explorer maps uses the same locating code as /locate, and that code is lagged out and often doesn't find structures, and if it doesn't find structures, then the trade doesn't unlock.
Then again, we can't be entirely sure, as the report is incoherent and provides no steps to reproduce the issue.
I'm pretty sure
/locate
can only locate structures in loaded/saved chunks.