It seems pretty likely to me that working a physical job late in life is correlated with lower income and wealth, which we know correlates to worse health outcomes. I would hope the study would control for that, but it's not clear from the article.
I would add that the physical exercise done during working is uncontrollable, at the difference of when going to the gym. The movements are extremely repetitive and have to be done even if it would be better to not do it
Plus, gym equipment is designed to be as ergonomic as possible (even something like a dumbbell is designed to be easy to grip and hold, contrast that with moving large, bulky equipment for a job).
Also, occupational physical activity often has exposure to harmful particulate matter and VOCs, such as in construction (or side: even the silicon fibrosis from rock shaping work recently discussed on HN).
Stress, also. People who go to the gym often do so in order to disconnect from the stress of their work.
I came here to say essentially that. The most I saw was "after adjustment," but it wasn't clear what that was exactly, and socioeconomic factors are such a large and obvious explanation they needed to address it clearly. Even if the referenced studies do, not bringing it up in this article is a red flag.
One thing to point out is that the study looked at Norwegians where while the wealth gap between high PA and low PA jobs is probably still significant it may be less pronounced than it would be in someplace like America or the UK. It still feels significant enough to be worthwhile to address though.