From time to time, the screen of my laptop will get stuck in a previous position and then suddenly revert back after I press some buttons to force it to update the screen. The problem doesn't appear if I connect it to an external monitor with a usb-c cable. I am extremely paranoid that this will eventually lead me to entering the wrong command in a command prompt. I have the nvidia driver xserver-xorg-video-nvidia/stable,now 525.125.06-1~deb12u1 amd64 [installed].
My laptop has sufficient ram of about 8GB, and nothing on htop shows any process using too much ram. It also runs a separate monitor without any issues so it doesn't appear to be an issue of video memory I believe.
FWIW, my money is on a driver problem. There seems to be a number of different drivers for MX250 on Linux. I suggest you search for a specific MX250 driver for Debian and the necessary steps needed to install it