There exists functions for specifically turning on/off the touch on the switch!
hid:sys's:

Cmd     Name
1320	[17.0.0+] WakeTouchScreenUp
1321	[17.0.0+] PutTouchScreenToSleep

(from https://switchbrew.org/wiki/HID_services)
But apparently the only advice for a broken/semi-broken touchscreen (with ghost touches. "phantom presses" or whatever..) is to unplug the digitizer cable.
Which kinda sucks! some people don't always have the touch problem, and some people don't wanna open their device and possibly break it.

 
Anyway I made a switch homebrew.. 'switchbrew'(?) .nro app to just run these functions.
you just open it and then press A to (temporarily) disable the touchscreen (so called PutTouchScreenToSleep) and or B to enable it again (WakeTouchScreenUp).
it's based on the example switchbrew touchscreen app, and keeps the screen test functionality from said app.

 
This took a lot of trial and error, which took a while because.. I don't have a switch !!!
so thanks oomf for downloading and testing random files sent via discord.
and also i've never touched any switch modding stuff so. yay

 
regardless go have fun https://github.com/iamasink/touch-screen
and ok maybe a sysmodule, an overlay, something like that would be better but this works. go make it yourself if you want something fancier. or give me money, idk. or a switch.
bye