Large terraform operations should deterministically succeed or fail based on the rate limits, for which some of the variables thereof may need to be widened (16 bit --> 32 bit, 32-bit --> 64 bit)
Large terraform operations can randomly succeed or fail when the rate limit settings are maxed out. For example, right after performing multiple large terraform operations in a row, there is an approx. 1 in 4 chance that the next terraform operation will fail completely.
Steps to reproduce
Load the attached savegame (the included game script does not matter here)
set terraform_per_64k_frames 1073741824
set terraform_frame_burst 65535 (not 65536, see #8610)
Open viewports at the top corner of the map and at the bottom corner of the map.
Drag from the top corner of the map to the bottom corner of the map (as indicated by the signs) using the level land tool.
Repeat step 5 a few times.
Using the raise land or lower land tool, shift-click on a tile repeatedly. Sometimes it will show "Estimated Cost", other times it will error with "landscaping limit reached".
This one puzzled me for a bit to understand, but as I fixed that terraform_frame_burst cannot be above 32k now, it is a lot harder to hit this bug. So be lucky you could test this while it could still be UINT16_MAX, as the bug is really cute :)
Fix incoming, if I can figure out how to fix this properly :P