Yes you do learn from it. One of the key lessons learnt is that you test boundary conditions. The fact that rudimentary testing didn't spot the error suggests that the design of the algorithm and the testing both matched a specification which had the wrong age limit.
It's much easier to blame the computer program than the senior NHS administrators who signed off the spec.