What could be causes of softlocks?

I stumbled upon a weird situation. I was making another function for different power up effect which uses scheme from other power up functions, it’s not big deal. But apparently I find out that this particular function cause softlock. When I deleted/commented this function, code works. With it, (even with empty body) while loading that module (gameplay module that loads after selecting start from menu), game freezes. Which is, can’t load game.lua, and just left in menu, app still works though. (debug prints in module didn’t show up in console so I assume it can’t load)

As far as I know, a cause could be left “and” or “==” empty etc. I had that problem before. But now I checked carefully that function and every other that I edited since code still worked, but with no succes. I won’t send the whole code 'cause it’s about 5k lines long and I wanna debug it by myself. I just want some hints about this situation.

Also I thought it could be problem with unwanted characters in document (i’m using Sublime btw.), I even noticed that i couldn’t write --[[ ]]-- comment at some point in area of that function. BUT I rewrite this part of code, and still doesn’t work. Even I send whole code to chatgpt to find some bad characters but no succes. More over, now code doesn’t work even I left this function or not. I have no clue why since I didn’t make any changes in file since rewriting function.

I made backup and started deleting some parts of code but nothing changed yet.

Any suggestions?