I think the days when you could just set up a company in some random country and run it from Germany are pretty over, the Finanzamt will just treat it as a domestic entity unless you can prove you've gone full nomad.
Btw. despite the myth, just being 182 days outside of Germany doesn't get you out of German personal taxes. It just stops taxation of foreign-derived income.
That does raise the question of what does it mean to have a permanent home available to you. And that's a much harder conversation as applied to the edge cases. But one can certainly construct viable enough scenarios where it would not be a close call even if one spends more than half the year in Germany, and then arrange one's reality to genuinely match the constructed scenario. Explaining to the Finanzamt (tax office) might need a Steuerberater (tax advisor) to argue with them, of course.