I think the issue is that you run lua code on every tick, hence bad performance of course, but you do that to avoid desyncs, which seem to be at the core of this.
Don't think I know why desyncs are affected by delays btw, as those should be stored in globals and synced across players just fine, but I'm sure there's some less obvious chain of effects that might lead to it, unfortunately.