First off, I have some good news: your "quick" math is off by more than you think. If you make monthly payments, the total interest you will pay is 427€ over 2 years instead of 800€. (Because you only pay interest on how much is left, which diminishes every month.)
As for whether this is a good idea, it's possible, but probably not. The only way this would mathematically make sense is if by taking this action your score increases by enough to land you a lower interest rate on the house, AND if that lower interest rate saves you more than the cost of taking the action.
For example, (using US numbers), suppose your credit score is currently 715 and you somehow know that if you take out the loan your score will soon increase by 10 points to 725. Now also suppose that with a credit score of 719 or lower your rate is 3.5%, and with 720 or above your rate is 3.3%. In this case the additional 10 points will save you 0.2% on your interest rate, and taking out the loan would be worth it because over time you will save much more than 427€.
However, those were completely made up numbers. The problem is that you can never be that precise. It's possible taking out the loan will initially lower your score, and it's also possible, even likely, that your score won't be right at the cutoff by the time you want to get a loan, and so those extra 10 points would be unlikely to have any effect at all. Even if your score went up by more than 10 points, since it's too difficult to exactly predict what your score will be in the future (especially since the scoring model changes periodically too), I would go as far as saying:
In general, it's rarely worth it to spend money with the single purpose of increasing your credit score.
Note I'm not familiar with the credit system in Germany, but it wouldn't surprise me if the same line of thinking applies.