The second «if» condition of the \Magento\Quote\Model\Quote::getPayment() method is always true

Look at the \Magento\Quote\Model\Quote::getPayment() method:

This if condition is always true:

It is because the \Magento\Framework\Data\Collection::getFirstItem() method always returns an object, even if a collection is empty.