Would it be an advantage in terms of admission, to study pedagogics before applying to a PhD?
While I have little familiarity with Sweden or Germany, for most technical fields I would see taking a year off to study pedagogy and teach high school would generally provide no advantages and perhaps even be a slight disadvantage for PhD admissions.  I see how it could be an advantage if you want to pursue a PhD in education for example as it gives you relevant practical experience and perspective, but not for most subjects as the primary goal of a PhD program is to train you to be a researcher.

As such, for a PhD, you want to demonstrate passion and dedication to research.  Pursuing another career path first may make some professors question this, and indeed from your question it sounds like you are not totally committed to the research track.  Of course, applying for a PhD program right after a master's doesn't guarantee commitment either and many great researchers got their PhD's after doing other things first. Pursuing teaching next may be the right thing for you if it helps you figure out what you want to do, but I would not recommend it as a way to help you become a PhD student.