The government was informed of a glitch that caused more than a thousand people to be cut off from welfare payments but ignored it for more than three years because halting it would harm private providers.