Just "having" a treaty is not enough. Germany has a treaty with Estonia, but it doesn't protect you. The Estonian company WILL become a german tax resident if the company is being managed by a German citizen living in Germany 99% of the time.
This is correct, and this applies to many OECD countries. There's generally little reason to set up a company overseas if you live in an OECD or EU country; foreign affiliate tax rules will get you.