I have tried many solutions posted online, but most of them did not help except for three things:
1. Under Display in system settings, make sure that "Change brightness automatically when lighting changes" is unchecked. This made the most difference in fixing ran random occurrences of black screens when I use the Surface Pen.
2. If you get a black screen when using the battery, install the Intel Graphics Command Center (https://www.microsoft.com/en-us/p/intel-graphics-command-center) and disable all the options under "Power"
- If you get black screens in specific apps (especially Zoom/Teams etc.), disable GPU acceleration in those apps.
After these changes, I only get a black screen occasionally when using the Surface Pen in Zoom and it then comes back after a few seconds. I am also getting the same behavior when using an active pen on a Lenovo laptop, so I blame Zoom instead of Surface for such black screens.
Hope this helps.