Sales Invoice for accounts confusion prevents saving publishing invoices

I have 2 companies (First Company and Second Company) in a frenshly installed:
ERPNext: v12.17.0 (version-12)
Frappe Framework: v12.14.0 (version-12)

I have created an invoice for the Second Company, but I can’t Publish it because I get the following error message: “Sales Invoice ACC-SINV-2021-00002: Account Sales - FC does not belong to Company Second Company”.

The charts of accounts are correctly created for both companies.
The Default Income Account of the second company has been changed to “Service - SC”, but the invoice still wants to save on the “Sales - FC”.
I can’t find the “Sales - FC” account on the invoice.

Any help is highly appeaciated.