Yes in theory.
In practice the German Warehouse will create substance and the german "Finanzamt" tries to tax the German Branch of the Malta Company - we were going through this with a very expensive tax adviser and we even figuered out that this on EU wide level should work and even found some examples.
However the German Tax Authority didn't want to accept the arguments and imply that one warehouse worker and the warehouse itself would even cause substance that is taxable - what's basically bulls**t.
So the deal from the tax authorities was basically either to pay taxes in Germany and get the VAT refund or to not pay any taxes and not get any VAT refund.
The issue was also that they doubt my residence on Malta as a German Citizen etc. - so they argumented with so many stuff that even the tax advisor that planned the structure initially didn't advised to take it to the court as the chances are very low.
Again on EU level and in several other EU countires we have seen this working with success.
Finally this was the trigger for leaving the EU and even shifting all the focus on how to do Business with a non-EU Company in Dubai within the EU by buying in China etc. and selling in EU
We have been doing this in Germany (with a UK company) without triggering any kind of profits tax in Germany. Also you could use the Malta Germany tax treaty which says that a warehouse doesn't create a permanent establishment.
I guess your problem was related to the fact that you were German and trying to get out.
Anyway, germany was just an example. OP could fulfill from Ireland or another place.