My Surface Pro 7 has the same problem, to a "T". These post describing the problem look like they were written by me! I have definitely traced the problem down to the power supply. As I swirl the mouse pointer around on the screen, it will eventually halt. If I keep my finger on the touchpad and reach over and disconnect the magnetic power plug, then like magic the mouse pad begins to work as soon as the plug is removed. I can operate on battery trouble free. I am in the process of evaluating the power supply problem. I have 3 different ones and one of the three is noticeably much worse. It is a compatible PD charger with the USB-C to magnetic plug. My USB-C charger, also a PD charger, is 65 watt and came with my phone. It uses a USB-C to USB-C cable. This one is pretty trouble free. This charger came with my chinese brand cell phone made by "OnePlus". I operate a test and quality control lab for a small electronics company, so I am going to do EMI, RFI and ripple measurements on a variety of power supplies to isolate the cause. For now I would recommend using the Microsoft charger. If that fails, which others say is likely, then try a high quality USB-C PD charger (PD = power delivery) and a USB-C to USB-C cable that support thunderbolt. Thunderbolt cable are likely higher quality and have better shielding to support the high data rates. Now we are only worried about power, not data, but the shielding is a benefit for both. As a matter of good practice, also keep your cell phone a few feet from your keyboard. I will report back on my lab test results later.
UPDATE: I have a replacement charge cable, USB-C to Surface Pro magnetic power connector and also a USB-C to USB-C cable. I can use either cable with a good power supply, no problem. So it seem either input method is ok, just a problem with the power supply I plug it into. My "OnePlus" cell phone charger works fine as a power source. I just bought an Amazon Basics dual USB-c 65 watt PD charger, lets see how this one works.
I have been using this Amazon Basics charger for a few days with a USB-C to USB-C cable, no problems!
https://www.amazon.com/AmazonBasics-Four-Port-Charger-USB-C-Ports/dp/B087MFDTL4/ref=sr_1_6?crid=V9KXQ5Q2S1H6&keywords=amazon%2Bbasics%2Busb%2Bc%2Bpd%2Bcharger&qid=1646599282&sprefix=amazon%2Busb-c%2Bpd%2Bcha%2Caps%2C306&sr=8-6&th=1