It is illegal if it is a condition of a private flight that a particular passenger must be carried.
I don't think it is. Not unless a payment is made for the carriage of that passenger.
But it
would be illegal if the check-pilot were paid to conduct the check. That doesn't mean that they have to be paid by the hour -- most commercial pilots aren't! If checking out other pilots were part of the job description of the employee of a flying club, I think that would make it aerial work, for which a CPL would be required.
The captain/commander of any flight must be obvious, easy with an FI on board as it is always you, but to have two similarily qualified and experienced pilots on board is a recipe for disaster in the event of any emergency.
I think there's a strong argument for agreeing who is PIC before any flight on which two pilots sit at the controls, regardless of the qualifications of those on board.