I'm not sure what my most reliable handgun has been. I have no idea how many I've had in the last fifty+ years. There have been more S&Ws than anything else and I've had minor problems with a very few. No more than thirty Colts; only had one problem with a Colt. Never a problem with a Walther, Ruger, Beretta, or Sig, but I've owned no more than a half-dozen of any single such brand, and the Beretta, only one. It's invalid and maybe unfair to make a reliability judgement based on a small number of one brand. I've had a few of the lesser brands but I've avoided these now for years. May be good guns but their resale value isn't.
Mechanical things fail now and then regardless of quality or price. Hard to single out a brand. I shoot my handguns, many of them a lot and a number were bought new more than forty years ago.
A bit off topic, but since someone's already mentioned Beretta reliability, I'll add a little more... a relative newcomer to my pile, I bought a new Beretta 92F 9mm in 1988, the only Beretta I've ever owned.
Being a cast bullet shooter, I bought at least a dozen moulds, got about that many or more powders, a bunch of lead and set out developing cast bullet loads - for years, many years. A Beretta is a great cast bullet shooter and mine will function flawlessly with .38 Special SWC bullets, something it was never designed to do. I have no idea how many thousands of cast bullets have been fired in my Beretta and I'm still waiting on the first jam/malfunction. It does well with jacketed bullets too, but cast are probably more accurate. Again, a sample of one gun, though incredibly reliable, may not be representative of the model.
The Beretta is a big, heavy, clunky pistol and I've never been a 9mm disciple, much preferring a .38 Special revolver. I doubt there is a safer pistol than the Beretta.