I don't think you really understand how the offshored profits work. It's not just that money isn't brought back from overseas, but that money made in the US can be sent overseas. You create a wholly-owned overseas company that gets paid to do some kind of work for you. Then you way overpay them for that work. As a wholly-owned subsidiary, all the extra money they hold is actually owned by you, but you don't pay taxes on any money you send them because you call it an operating expense. So you effectively send a bunch of money overseas untaxed. Your German division does the same thing, and now all your money is sitting in the Cayman Islands waiting for a tax holiday so you can bring it home.
Your German company scenario is incorrect as well. Firstly, because they don't have to make any significant profit in Germany. US Sprocket GmbH could buy the sprockets from US Sprocket Inc at nearly the same price they sell them for, transferring the money to the US corp while paying almost no taxes in Germany (high revenue with equally high costs means no profit). Secondly, Deutsche Sprocket GmbH is dealing with the same "double taxation" in the US, so it's not an economic disadvantage.