When you trade a cartographer until you unlock his explorer maps. The game freezes for a while until it has succesfully found a mansion...
The game hangs for a significant amount of time.
I suggest making mansions less rare, so the time to find a nearby mansion is faster, or have it search on a different thread so it doesn't affect gameplay, while the map loads it could say 'loading'...
if you use /locate Mansion
it also takes forever to find one.
MC-126244 '/locate', explorer maps, and treasure maps can cause extreme TPS lag, even leading to a complete server freeze if structure generation is turned off