From which year do MacBook keyboards have no issues?
Generally speaking, any Apple laptop available for sale from May 2020 comes with a comparatively reliable keyboard.

To elaborate, the distinction you should be looking for is whether the laptop comes with a Butterfly Switch key mechanism vs Scissor Switch key mechanism.

When it comes to recent generation of Apple laptops, there are basically categorized into three distinct classes (increasing order of performance, decreasing order of portability):


MacBook (marketed as New MacBook released between 2015-2019)
MacBook Air
MacBook Pro


Apple first introduced Butterly Switch keyboard design with 2015 MacBook. Butterfly Switch keyboard featured flatter key design with lesser key travel, and an entirely new internal mechanism. Butterfly Switch design was then incorporated in the re-designed 2016 MacBook Pro lineup (13" and 15") and subsequently into 2018 13" MacBook Air.

Apart from having difference in terms of tactile feedback, key travel and user experience compared to the predecessor Scissor Switch design, (which could be subjective) Butterly key design, in general, performed poorly in terms of reliability compared to their ancestor Scissor Switch design.

Due to growing user concerns, the Butterly Switch design saw iterations over four generations where the internal mechanism was tweaked and new materials were used, but the reliability issues still persisted to an extent, causing Apple to launch the Keyboard Service Program. Under the program, customers are eligible to get a service or even a replacement of keyboard if needed, free of cost.

However, starting recently with the introduction of Late 2019 16" MacBook Pro which was released in November 2019, Apple attempted to address the issue with an entirely overhauled and enhanced keyboard design based on Scissor Switch and re-branded it as New Magic Keyboard. The general response for the said Magic Keyboard has been 

This scissor mechanism has been further adopted into Early 2020 13" MacBook Air, released in March 2020, and subsequently in Mid 2020 13" MacBook Pro release in May 2020.

With this last release, the transition of the entire lineup of Apple laptops to use scissor switch is complete and they are all re-branded as the New Magic Keyboard.

Apple has discontinued MacBook from its laptop lineup in June 2019.