How a prolonged sick leave history may negatively affect the hiring on future jobs

In your original post you said:

Concerning pension funds, there is no medical examination to join your employers pension fund, there has not been for about thirty years.

The two comments seem to contradict themselves ;-)

They should not and in my experience the company doctor does not share Patient Details with HR. Will only say what accomodations are needed at work.

True, should being the operative word

Wel I put should because clearly I cannot know what each and every company does but would be a serious breach of doctor-patient confidentiality which is taken pretty seriously here.

I know, but the reality is when you work somewhere long enough, everything about you becomes in someway known. I‘ve never known it cause great problems. Medical issues are treated very fairly. And I‘ve worked all over the world in large and small organizations. Just my experience and observations and that of course leads to how you approach it. Either honestly or not.

The form the OP is referring to is probably the questionnaire for supplementary coverage. As others have also mentioned, this is for higher salaries, where your benefits are over a certain threshold, so the pension fund sends a form where you answer basic questions for them to understand if you qualify for the increased benefits or not.

I don't think it's likely that someone finds out about health issues, and honestly if they do and if they bring it up as an "issue" I would run away and thank the stars they showed their toxicity before joining.