FYI Hollywood made a movie about this very subject, Stealth from 2005. https://www.imdb.com/title/tt0382992/ The plane goes rogue but humans ingenuity saves the day.
On second thought, maybe not the best idea for armed drones...
I think that trope came up in the time (of Sci-Fi) when it was thought that an AI would be a logic-based supercomputer of some sort.
Neural network based AI presumably won't suffer from this issue because neural networks do not depend on logic at all for their functionality...!