A quick note about keyboard actions:
Depending on personal preference and ability to bend/flex fingers, people do use the Space key and stylus touch-move to pan the canvas instead of using the stylus button. Other useful ones are Ctrl+Space which will zoom the canvas with up/down stylus movement. Shift+Space will rotate the canvas with stylus movement.
The eraser mode toggle is the ‘E’ key so I’ve no idea why a stylus button press should be causing this especially since it works ok to pan the canvas.
If the eraser mode is set active by the stylus button panning action, does a further stylus button panning action turn the eraser mode off?
Are you using krita 4.4.3 and Windows 10?
4.4.3 was recently released so you might want to update to that if you’re on 4.4.2.
Is the Huion driver on your new PC a recent download of the latest Huion driver or is it the one you also used on your laptop for some time?
You should use the latest Huion driver for the PC.
If you need to update it, disconnect the tablet, uninstall the old driver, restart the PC, install the new driver, restart the PC, connect the tablet, run krita.
Given that the stylus works normally to paint with good pressure sensitivity, I’m not going to suggest swapping the krita settings from Wintab to Windows Ink (or vice versa).
However, as a quick check, go to Settings → Tablet Settings and note if the Wintab or the Windows Ink box is enabled.
If it’s Wintab, make sure that Windows Ink is disabled in the Windows system settings. If it’s set to Windows Ink at the krita side, make sure that Windows Ink is enabled in the Windows system settings.
You can’t go much further with this unless you use the Huion tablet settings/config utility which will be there on your PC and you may be able to find it by typing ‘Huion’ or ‘tablet’ in the search box of your Windows menu.
The tablet settings/config utility will have all kinds of settings adjustments in it, any of which could be related to this problem.
EDIT:Add: Also, note this topic:
Bug with my Huion Tablet and Krita
and especially the reply from @halla.