I don't have an opinion on whether FP generates less bugs than OOP. I need to see an example written in each style side-by-side to decide which one I prefer.
Then I guess you need an example with the same language? Because I personally cannot give you an example in the same language.
Also I won't give you an example from my experience because I'm a novice. But I've been watching some Elm courses where instructor gave some examples and said that the opposite JS code will actually end up biting you in the ass.
I also want to say that a lot of things end up biting in JS are the lack of types whereas Elm has a strong type system. You probably need an example that demonstrated exactly the difference between two styles rather than the difference between having strong type system and a week one.
It's worth saying that those examples are hand picked to show the strengths of Elm.
Ed, I just a found a talk by Richard Feldman talking about null and how it propagates into the code. I'm currently watching it and I'm on minute 7.
I will provide the link. But I have to say, that I don't know if this is the example that you want to see. But please do watch this talk even just a little bit, because I'm interested in your opinion on this.
We’re a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.