This is true, but I think it's better put this way: The key is making it a hobby.
Expertise comes with experience and experience will only come if you keep coming back. Some people can force themselves to toil endlessly, but here's some wisdom for mere mortals: start by searching for a part of software that you can truly love, then cultivate it.
It is also a good idea to place the hobby part of programming in a related but not same field/tech stack than you day job.
If you simply do more work in your free time you might burn out. You want something that provides relaxation but still synergy effects with your day job.
Expertise comes with experience and experience will only come if you keep coming back. Some people can force themselves to toil endlessly, but here's some wisdom for mere mortals: start by searching for a part of software that you can truly love, then cultivate it.