It's not about removing this check, I found similar script here:
https://otland.net/threads/bug-problem-open-hole-in-sand-if-there-is-splash-in-the-spot.283576/#post-2713723
You need to define posSand:
local posSand = {
fromPos = Position(33018, 32894, 7),
toPos = Position(33306, 32530...