https://www.taptrail.com/world-record-for-most-beer-taps/
I really struggle to believe they keep 366 beers in the best condition possible. And I don't get why it's a goal in the first place. I don't think anyone is making a meaningful choice between 366 beers and I bet they often get a disappointing one when they select something that nobody else has picked in the last week.
If a bar has the sort of foot traffic/clientele/supply chain to support 366 different beers on tap then good for them, some do, it's not an easy operation to run. They also usually buy mini-kegs for quick turnover. If they are serving garbage quality beer that's been sitting for months then they probably wouldn't be in business.
The place I used to frequent that has around 25 beers on tap usually had a turnover of about 50% of taps/week from what I saw.
Shrug the Delirium Café in Brussels has 2000 beers on tap.
I worked for a pub for a while that did beer and wine only with 20 taps. We definitely had the occasionally stinker that sat around for way too long (if it sat around too long, it would start getting poured for the staff and regulars on the house), and we had our usual suspects that would pop almost every day. By and large though, it was rare for any given keg to last over 4-5 days.
40 is a lot more than 20, but we were a relatively small bar that didn't even open on Sunday.