I can't find the sentence in the link you provided. The question “Was it
necessary that Alan should have been invited to the meeting?” is
technically correct, but unnecessarily clumsy, and I doubt that a native
speaker would say or write it in normal present-day parlance. You might find
this construction in biblical, legal or formal style.
- Musel být Alan pozván na schůzi?
- Bylo nutné, aby byl Alan pozván na schůzi?
The (unnecessary) “should” is a subjunctive, and the (unnecessary) “to
have been invited” is a past passive infinitive. The use of “was” already
tells us we're talking about a past-time situation, so the past infinitive is
not necessary.
It's not advisable to use a that-clause after “necessary”,
because it just complicates the choice of the following verb form.
The simplest and most elegant construction after “necessary” is
necessary for someone to do something, necessary for
something to be done.
Different ways of expressing the same question:
- Did Alan have to be invited to the meeting?
- Was it necessary for Alan to be invited to the meeting?
- Was it necessary to invite Alan to the meeting?
- Should Alan have been invited to the meeting?
- Was inviting Alan to the meeting necessary?
Out of context, we don't know if Alan was at the meeting or not.