I had a 2016 that got the keyboard replaced 7 times before they upgraded me to a 2017 on which I replaced the keyboard 5 more times before I gave up and sold it.
Each time they replaced the top-case which includes the entire battery assembly, touchbar, speakers. Valued at $800 just for the parts each time. That's $9600 for everyone keeping score.
I called Apple's bluff on saying their keyboards are reliable.