Im afraid you mix some things here. This article talks about Foreign investment in Germany. It’s not talking about business environment or business issues of German companies - what the politicians and CEO‘s talking about.
For example, if danish company DSV buys the Deutsche Bahn cargo part, this is a direct investment of a foreign company in Germany. It counts for the figures here. DB Cargo has profit issues and was sold out of that reason. Edit: in 2024.
Heating tech company Viessmann was sold 2023 for 12 billion to US company Carrier Global and will be counted as well as a direct investment.
Sure, even new buildings and factories will be erected and counted in the sum. But it doesn’t tell you, that German economy is well. It might be the opposite and foreign companies are on shopping tour in Germany. However, the numbers can’t tell the background, it tells the volume of transactions only.
Edit:
“FDI encompasses all kinds of cross-border investments made by an entity resident in one economy (direct investor) to acquire a lasting interest in an enterprise operating in another economy (direct investment enterprise)“