Hello!
It sounds like this is happening with some of your devices and not others? If so, I do not think it is a code issue, but rather a hardware issue with those malfunctioning devices. I would first confirm this point - if your code works on some of your devices then the code is fine and you can switch your focus to the hardware on the misbehaving devices. If it is happening on all of your devices it is likely your code.
Hardware-wise, the most common reason that nose-poke will register during startup but not once a mode loads is that the pellet sensor in the center port is dirty or dusty. If FED3 thinks there is a pellet in the well it will not respond to additional pokes in that state. In this case, the simplest solution is to clean the inside of the sensor with a cotton swab and 70%
ethanol and see if that fixes it. If you look closely at the pellet well you'll see a small
LED and a detector inside the arms of the pellet sensor - give both sides a good cleaning. A fine needle can also help if the pellet dust is caked on. Here's what it should look like when it's clean:
Best, -Lex