Nope, that doesn't fix the issue.
The issue is that when you have all three options checked in the node, 'environment' is never returned.
Here is a simple test flow so you can see the number of msgs returned.
Remember the if you change sensor hat.py
you must restart Node-RED before testing again.
NOTE: you will have to install 'node-red-contrib-counter' for this flow.
[{"id":"a94be90051639b30","type":"switch","z":"72bc62f170dc8752","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"environment","vt":"str"},{"t":"eq","v":"joystick","vt":"str"},{"t":"eq","v":"motion","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":450,"y":420,"wires":[["00565d90f8b06675","a3fdd7a258d8506b","1d8cadbb78ae0076","5628700cc303ddec"],["f79dfaa36cd93353","808f259f9bfd243b"],["cec6e96f900abe26"]]},{"id":"2f281db51b977dbd","type":"rpi-sensehat in","z":"72bc62f170dc8752","name":"","motion":true,"env":true,"stick":true,"x":280,"y":420,"wires":[["a94be90051639b30"]]},{"id":"808f259f9bfd243b","type":"counter","z":"72bc62f170dc8752","name":"joystick","init":"0","step":"1","lower":"","upper":"","mode":"increment","outputs":"1","x":620,"y":420,"wires":[["2db1fdc0ca54e01e"]]},{"id":"5628700cc303ddec","type":"counter","z":"72bc62f170dc8752","name":"environment","init":"0","step":"1","lower":"","upper":"","mode":"increment","outputs":"1","x":630,"y":360,"wires":[["e6014bc89d73560d"]]},{"id":"cec6e96f900abe26","type":"counter","z":"72bc62f170dc8752","name":"motion","init":"0","step":"1","lower":"","upper":"","mode":"increment","outputs":"1","x":610,"y":480,"wires":[["d1b47431a5a8936e"]]},{"id":"e6014bc89d73560d","type":"debug","z":"72bc62f170dc8752","name":"environment","active":false,"tosidebar":false,"console":false,"tostatus":true,"complete":"count","targetType":"msg","statusVal":"payload","statusType":"auto","x":810,"y":360,"wires":[]},{"id":"2db1fdc0ca54e01e","type":"debug","z":"72bc62f170dc8752","name":"joystick","active":false,"tosidebar":false,"console":false,"tostatus":true,"complete":"count","targetType":"msg","statusVal":"payload","statusType":"auto","x":800,"y":420,"wires":[]},{"id":"d1b47431a5a8936e","type":"debug","z":"72bc62f170dc8752","name":"motion","active":false,"tosidebar":false,"console":false,"tostatus":true,"complete":"count","targetType":"msg","statusVal":"payload","statusType":"auto","x":790,"y":480,"wires":[]}]