lovlas: i just checked, this can still happend in chess 960 with that turned off.
Tbh I really don't see the problem. If you manage to misclick castle you are doing something wrong.
In chess960 you can only castle by moving king onto rook. The setting does not apply in this case.
IM lovlas, I guess he cliciks the king and then regrets that and want to move the rook and when he clicks the rook he castles instead.
"Just turn it off in the settings:
lichess.org/account/preferences/game-behavior.".... worked for me... thanks.