Don't delete templates.
Even if your experiment with deleting {{langprefix}}
hadn't run afoul of wiki errors, it still would have broken things, because the job-queue means that the recreated version doesn't instantly become available. Take a look at [[oinker]], for example; it's one of many entries that are completely broken for now.
(And the job-queue isn't 100% reliable, anyway. It wouldn't shock me if some of these entries will remain broken indefinitely, until the next time someone edits them.)
I didn't actually mean to delete that template. I wanted to overwrite it with the new version and move the subtemplates at the same time. Because of the order in which the software did it, it deleted the main template first, then tried to move the new one over it, and then tried to move the subtemplates. What really should have happened is that the subtemplates should have been moved first.