It's not like they ever written a bad album and very seldomly bad song
I guess you may count Yellow Submarine soundtrack as a bad album but half of the album isn't really the Beatles but some orchestrated music by George Martin
However taking in consideration of consistency married with longetivity
I think Sparks and The Rolling Stones are a fairly consistent band. Sparks only have about 3 dud albums in their career. The Rolling Stones only have 4 dud albums.
That's a good record for 20+ albums
Genesis with 3 bad albums, R.E.M. With two bad albums are also consistent for a 10+ album career