Ran phpstan analyze -a autoload.php phabricator/src.
This test case is no longer doing anything with $day so I think it can't be right, but I can try to figure that out and follow up.
We should just remove this: it has no callsites and was improperly copy-pasted. This object has no status, inviterPHID, etc., properties, so this code will fatal even with this fix.
I think this case can just be removed instead. Conpherence threads are no longer required to have a title (if they don't, we'll create a default one by listing the participants) and I think this just never got cleaned up.
ERROR_EMPTY_MESSAGE should be impossible when creating a thread and I think it only refs to sending an empty message to an existing thread.
I've changed it to getTimestamps($u, $day, 1) and the test now passes.
Note that it returns PhabricatorCalendarEventInvitee, not PhabricatorCalendarExternalInvitee. I'll submit it like this and let you follow up.