I am not sure about the behaviour when a user tries to override a setting via GNOME Tweaks, but the system-wide configuration is in /etc/systemd/logind.conf.
Uncomment the lines that say HandleLidSwitch, HandleLidSwitchExternalPower and HandleLidSwitchDocked and change the values to ignore (or however you want them configured).