/**
* @return string
*/
public function getCustomerName()
{
if ($this->getCustomerFirstname()) {
$customerName = $this->getCustomerFirstname() . ' ' . $this->getCustomerLastname();
} else {
$customerName = (string)__('Guest');
}
return $customerName;
}
As you can see, if the first name is not set on order, which is the case of being a guest, then translation of 'Guest' is returned.
To achieve your goal you can get first/last name from a shipping or billing address
$shippingAddress = $order->getShippingAddress();
$fisrtName = $shippingAddress->getFirstname();
$lastName = $shippingAddress->getLastname();