When I write a class, and I attempt to create my __construct, getters, and setters using "Code Actions," I usually have to attempt this several times before it will actually work.
This is true whether I click on the lightbulb and then click on the requested action or alternatively, type Ctrl-. then arrow down to my desired action and then press Enter.
If I keep trying, it will eventually always wind up working, but sometimes I have to try an insane number of times before it does. I'm talking like 10+ attempts sometimes.
Also, you might wonder what happens when it doesn't work, and the answer is nothing at all. It acts like nothing at all was attempted.