That is completely unproblematic, simply allocate the loan correctly in percentages, then it works.
The problem here could be that depending on the equity contributed, the loan portion for the photovoltaic system decreases.
Example
without BV
Construction costs 400K€
Equity 100K€
Financing 300K€ (share 75%)
with Photovoltaic
Construction costs 412K€
Equity 100K€
Financing 312K€ (share 75.73%)
Photovoltaic share
Construction costs 12K€
Financing 9.1K€ (share 75.73%)
With separate loans, in the case of 100% financing, the interest for the entire 12K€ could be deducted.