If a MacBook Pro trackpad can click and scroll, swipe, move
cursor, etc. during a under diagnostic test (when I start booting
down the D key) then I can rule out that it has a hardware
Mostly, yes. It is extremely rare / improbable that the hardware will work well in one environment, so completely fail in another. In such cases, there is a software problem (ie conflict with other software, bad drivers / errors, error configurations, etc.).
Your next step to diagnose the problem will be to …
- boot in safe mode
- boot in recovery mode
- start a clean and / or older version of macOS from another volume (a 1
The idea of anyone / all of the above is to get the operating system as close to the factory as possible for testing / diagnostics. Safe mode is not always "factory fresh", but Recovery and a clean installation on another volume are. If you have an older version of macOS you can install on an external volume, consider whether it is your latest update that causes the problem.