Airlines have been known to escort IFC passengers from the lounge to the gate.
I wonder what times were involved: What are the hours for the lounge and when does the CX flight depart? Seventeen hours suggests to me that the lounge closed for the night without discovering him. In fact, doesn't the SFO terminal close for a few hours in the middle of the night? If so, wouldn't it be a security violation to permit someone to stay through the night?