Whenever using the execute command, the command block will only sometimes run properly (a command block that works will not work in a different spot) this is obviously an issue if you want to use command blocks as finding those spots that work is annoying and there is no reason it should be that way. quick demo: https://youtu.be/DxVKCQtURvc
Please provide a screenshot of the setup with your F3 debug screen enabled,