Pursuing Ph.D abroad vs staying in a stable job abroad
Those are big questions and I can't give you answers to them. It is your call and yours alone.
BUT, I can give you my point of view. I fairly recently finished a 6-year-long PhD in the UK. I was already a bit older than the average student when I was starting it and moved to the UK from Austria.
Personally, I don't recommend doing a PhD unless you want to stay in the academia.
If you want to become a university professor, there is no other way than doing a PhD. From a professional point of view, it often not worth it (money is not always better than with a Masters &amp; you get harder a job, because you are suddenly overqualified). However, if you really want to do one (because of whatever reasons) and you would end up regretting not doing one, then do it. (consider also the next points)
How is it to do a PhD:
It really depends on who your supervisor is!!! (I can't stress that enough)
While it is for some people a great experience, and they love their PhD times, in my experience, the majority of people don't have a great time.

You are under a lot of stress for long periods
You write and try to publish a lot (many supervisors pushing for publications because it benefits their own profile).
In many cases, you need to do a lot of work on the side that doesn't add to your PhD.
Generally you work significantly more than 40h a week.
The pay is not great (depends on the country). In the UK you have 1200 GBP/month to live from. That's not much. The payment usually goes for 3 years, but most people needed 4. (I needed 6).
Depending on your supervisor this can be a bit more relaxed or very stressful and frustrating. In my group of friends, most people didn't have any social life and other activities. They just lived for their PhD (me included).
However, it is not all bad. It can be quite interesting (the work), you go on conferences where you meet other scientists and exchange ideas (if you can afford to go).

Where matters:
Doing a PhD in the UK is very different to doing one in Germany (for instance).
In the UK, you are treated like a student (similar to an undergraduate student). You don't have a salary and you're not employed.
In Germany, you are treated more like an academic/colleague and you're usually you are employed. It doesn't sound like much, but that makes a big difference on how you are treated.
In the UK, you can do a PhD in 3 years with very strict deadlines. In Germany, it is more open. It takes as long as it takes. (This can reduce stress)
Mental Health during a PhD:
OK I make this a specific point because it is important to say.
A PhD is very stressful and demanding on your mental health as well.
I had many co-PhD students that ended up with a bad depression; one even suicidal. This stems for many things: for instance, from high stress, sometimes social isolation, insecurities (being not sure about their work, their skills, their progress ..),...
A lot of PhD students just dropped out because they couldn't take it.
Social Contact:
The good thing in a PhD is that you have other PhD students going through the same as you and you can bond very well. (depends also on you personally). I got great friendships from my PhD times. But that also depends on how you approach people. Many PhD people (especially in engineering) are a bit socially awkward; if that's not a problem then you're fine :).
Having said that, if you worked before and do a PhD a bit later in life, it can be also tricky as many PhD students just finished their degree (23-years old in the UK). They are in a completely different stage in life.
Applying for a PhD:
If you still want to do a PhD, pick a Supervisor carefully. Email them, ask them for ideas or upcoming projects. Try to visit them in advance and see how they are and maybe talk to some of his/her PhD students separately. You WILL spend years working with him/her! I didn't do that and there were moments when I really regretted it.
In most cases, they want you to come up with an idea. That's really difficult, particularly if you haven't work in that area for long. Try not to be too practical. Have a theoretical component as well.
If possible try to get a funded project. A funded project is usually well-defined and most PhD students with such pre-defined projects finish in very short times and had great experiences. In contrast, a good friend of mine started his PhD without any boundaries and suffered for long period as couldn't define the focus of his work (even after two years). In the end, it turned out well.
So this was a longer post (sorry). But. I want you to be aware of how it is. I was oblivious to most of these point.
Overall, I can't tell you what you should do. Try to see if your local University offers interesting PhD places, then you don't need to move and PhD-salaries are generally better in Germany. Try socializing apps, if you feel isolated. Germans can be a bit distance and one feels easily isolated, but in my experience, they welcome you if they see you making efforts. If you want a restart, then moving is also a great opportunity.