Hey Joshua, so regarding the command block "bug" it actually isn't a bug. It was a feature in 1.17.40. An easy work around to fix it is to add another command block before it (don't change the settings) and than change the command block with a tick delay to a chain block and always active.
This issue just started with the recent update 1.19.31. The issue is same as described above.