No, the HtmlTemplateInvoice() class always expects an object of type OrderInvoice, so there will never be a problem.
The HtmlTemplateDeliverySlip() class accepts both types of objects (Order or OrderInvoice). This historical code error only triggered a warning up to PHP 7.2, but beyond that, it's a fatal error.