When I use the locate command to search for any structure in a world where "structure generation" is disabled, the game enters an endless search loop and never returns coordinates for a structure. Additionally, I seem unable to use any commands afterward. When I try to leave the world, the game also becomes unresponsive on the "Saving world" screen. I believe this command should either be disabled in such worlds or return a message like "No structures available in this world."
This issue is already being tracked in MC-269520.