The Bug
When doing /locate desert_pryamid on a desert superflat world the game will freeze. You can still move around and break blocks but chunks will stop to load and entities won't move
Reproduce
Make a superflat desert world type
Do /locate desert_pryamid
Observed Result
The world froze
Expected Result
The world wouldn't freeze
Note
This didn't happen in 1.17.1
I am able to confirm this behavior.