Before you go too far, turn the radio on and see if when the gyro initializes, if the red LED comes on and stays on. If it doesn't, you're not initializing the gyro with the radio set to select Heading Hold mode. The GY401 MUST be started in HH/AVCS mode, or it won't work right.
So, after you apply power and it finishes its initialization, the red LED must be ON solid. If it's NOT, go set up your radio to make it happem.
If the gyro comes up in the right mode and the red LED is on, the next thing to check is to see that your RUDDER trim setting is identical for each flight mode you are using. If the rudder trim is different between flight modes (IDLE UPs), simply switching modes will confuse your gyro. It will also make the gyro go into slow blink mode, as it no longer knows where the neutral position is.
If you use your rudder trim tab ANYTIME in heading hold mode/AVCS mode, the gyro will also be confused about where neutral is, and won't work correctly. NEVER, NEVER, NEVER use the trim tab on your transmitter after the gyro is initialized in HH mode.
Beyond that, if for some reason the voltage going to your gyro dropped WAY LOW momentarily, the gyro can go through its power-up initialization sequence again. If you're flying when that happens, it could have real nasty results. I did a bit of checking last year with a 401 that I thought had done the low-voltage reset in flight. What I found was that the particular 401 I was testing was good and solid down to at least three volts.
Go check your initialization sequence, followed by the flight mode rudder trim setting, followed by not using rudder trim while in flight.
If you happen to have REVolution mixing enabled on your transmitter, disable it or dial it to zero.