Square pattern when generating terrain

Godot Version

4.3

Question

I’m generating terrain with the following method:

https://pastebin.com/6pbbfkJh

The resulting terrain has square patterns, why could that be?