This was my problem. Garage door opener would work fine from 2 houses down when coming home. But wouldn’t shut the garage door from 15’ away after I backed out and the light was on. I finally bought a specific garage door opener light bulb at $7/each and now it works fine.
Probably not the OP’s problem but could be an issue for someone else.