When I was an undergraduate, one of my math professors, Theodore Faticoni, explained to us the difference between a useful wrong proof and a useless wrong proof. When attacking an unsolved problem such as the Riemann conjecture, a useful wrong proof was wrong; but for reasons nobody expected. Finding the flaw in the proof taught you things about the problem you didn’t previously know. By contrast, a useless wrong proof was wrong for obvious reasons. It didn’t teach you anything new about the problem.
In fact a useful wrong proof could be far more valuable than a prosaic right proof. For instance, Yves Hellegouarch’s discovery in the 1980s that Fermat’s last theorem was closely related to elliptic curves was far more interesting and practical than the eventual use of that knowledge by Wiles and Taylor to finish the theorem. Similarly and much earlier, Euler’s “proof” of the theorem for the special case with exponent 3 was wrong, but nonetheless suggested many avenues of attack on the problem for the next couple of centuries. Writing software can be the same.