To be legally offshore, the management of the company placed offshore, needs to be offshore.
Most governments in the world have laws saying tax regime is placed where the management of the company is placed, it doesnt matter what the offshore country say, what matters is what the country you live in say since it is the company you live in that can put you to prison

A Panama foundation that own 1 or more companies is an option, but dont start doing that without having a local tax expert involved