Maybe sometimes? With how many bugs are normally found in very complex code, would a rational spy agency spend the money to add a few more? Doing so is its own type of black op, with plenty of ways to go wrong.
OTOH, how rational are spy agencies about such things?
Yes. Of course not all.
But some just happen to work too well.
But governments do have blatant back doors in chips & software.