A really strange phenomenon is plaguing me [innocently working on my laptop] for the last two days. The brightness keeps resetting periodically (probably every 1-2 minutes) to the highest possible value. My brightness keys don't work, either.
My nvidia-smi is
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 465.27       Driver Version: 465.27       CUDA Version: 11.3     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0  On |                  N/A |
| N/A   49C    P8     3W /  N/A |    455MiB /  3911MiB |      8%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A    121351      G   /usr/lib/xorg/Xorg                 59MiB |
|    0   N/A  N/A    121608      G   /usr/lib/xorg/Xorg                235MiB |
|    0   N/A  N/A    121736      G   /usr/bin/gnome-shell               34MiB |
|    0   N/A  N/A    122281      G   ...AAAAAAAA== --shared-files       18MiB |
|    0   N/A  N/A    122706      G   ...AAAAAAAAA= --shared-files       95MiB |
|    0   N/A  N/A    130318      G   /usr/bin/nvidia-settings            0MiB |
+-----------------------------------------------------------------------------+
I have tried multiple fixes. I've set the "EnableBrightnessControl" to true, tried editing a lot of config files, run xrandr --output DP-4 --brightness 0.3 (even run it periodically to set it back to 0.3 using the watch command, that makes it flicker when the reset happens and really destroys my eyes). I've also tried using nvidia x-server to set the brightness and contrast myself. But it always resets within a matter of minutes.
Any help will be massively appreciated. I can add any logs or outputs based on comments asking for them.
My GPU: GTX 1650
Output of cat /etc/X11/default-display-manager is /usr/sbin/gdm3
EDIT: One interesting point is that it stopped last night after I disabled night light!