Does it make sense to get a second M.Sc. while pursuing a PhD? The situation: You did your B.Sc. and M.Sc. in CS with focus on subfield X1 and are now pursuing a PhD in subfield X2. There is a Masters program in subfield X2 available where you do your PhD that offers courses that allow you to advance in this subfield (which is pretty new to you).

Does it make sense to get a second M.Sc. while pursuing a PhD if the courses of the Masters program will be beneficial to your PhD work?
Subquestion: Do you think it is even feasible to do this based on your experience?

The geographic context is Europe/Germany so a PhD does not include course work. A Masters (at a university of applied sciences) takes 3 semesters full time with the possibility to double that time when doing it part time.
In Germany, as has already been pointed out, the Master's degree is a prerequisite for enrolling in PhD "studies." It should also be pointed out that in the German system, PhD students are Wissenschaftliche Mitarbeiter (research employees), so it is expected that they would devote all of their time to research activities. Enrolling in a second master's program would run contrary to those expectations, unless you are only a part-time employee (and receive a correspondingly reduced salary). That said, it is possible to sit in on additional classes as a listener. (And generally this is required if you are coming from a foreign country!)