Was the subsidy system which was in effect in 2010's unsustainable? I think so, yeah. But the changed policies resulted in companies producing solar going bust, and the Chinese firms, which were doing fine, were able to buy out the patents and know how.
So, did Germany waste billions? Yes, but by letting the solar producers go bust.