PhD Perfect fit topic + insecure funds vs. non-optimal topic + secure funds This is probably more of a request for an advice than a pinpoint question.
Nevertheless I'm interested in hearing the take of others on the topic.

Background:

I have graduated in Germany, 2 years ago, with an excellent master's grade (converting to GPA: 4.0)
in theoretical physics (c.f. Alleviating Dunning-Kruger effect without running into impostor syndrome)
My work has no practical applications but I liked the theory and math. It took a while to
get started looking for a PhD position, but I've been looking for one for ~ 1 1/2 yrs,
first for publicly listed ones, then actively suggesting research topics myself.
Unfortunately those who were interested in my suggestions had no funding available.
Since my former adviser had no real external relations he could not suggest anybody to
me to check for an open PhD position and I've been looking on my own.

Status:


Over the past months I have found one position in Austria where the topic fits to a T.
It will be very mathematical and concern fundamental research (light-space-matter) with no immediate practical
applications and possibly no immediate experimental verification (unless I can find
collaborators to perform some experiments).
Simultaneously I got an offer for a PhD at a large research association in Germany (Helmholtz society)
in a field I am not familiar, but am interested in. I got the offer after expanding my criteria
though. This position would require a very nice mix of theoretical physics,
mathematics and talking with experimentalists to compare theoretical predictions
to experimental results.


Problem:

The position in Austria fits perfectly to my interests, although I have (and always had) doubts as
to whether I can handle the math. BUT funding is definitely available only for 1/2 year. Afterwards
the continuation would be conditioned on a) the adviser being happy with my work and b) whether
further funding will be available.

The position with Helmholtz does not fit perfectly to my physics interests. The funding and
additional benefits are available for 3-4 years and I have no doubts that I can handle the topic.
Its major "Pro" (apart from job security) is the active collaboration
of different research fields, something I've been trying to foster during my M.Sc. (in vain I think).

I can not guarantee, that I will be able to supply the funds (self-fund a part of the PhD) should
the funding run out, so my ideal position becomes quite a risky option. Given the assurance
of availability of funds I would take that position without a second thought, but
I very much want to avoid having to stress myself out after 6 mo. looking for a new position - again.

Query:

Is it advisable to choose a PhD position where the topic fits, but the financial security
of the position is questionable?
Or would it be more prudent to select the more secure position even at the cost of it not
being a perfect fit?
How easy/hard is it to get a post-doc position in a topic which is not perfectly aligned (still physics though)
with the PhD one has done?

Complication:

I might be able to secure some funding through an ongoing collaboration
on a different topic (a pet project), but that will definitely not be 1 FTE (maybe 0.25-0.5 FTE).
If you are anything like the numerous phd students before you, myself included, your interests are very likely to change as you are exposed to different ideas from new colleagues. 

The Helmholtz position sounds like a great place to do a PhD. Firstly, you get funding. That is important. Secondly, you get a large group of colleagues where you will be exposed to new ideas and ways of doing things. You might find that your knowledge of things like gradient descent and differential equations fits perfectly with machine learning. You might discover you have a love for programming when scripting simulations. 
You might even be like a friend who decided to leave theoretical physics and pursue finance in New York. 

And there is nothing to stop you from pursuing your interests during your phd career or even in a postdoc. 

As for your post-doc position, it depends on the position. Sometimes a PI wants a post doc with a very specific set of skills and knowledge. Sometimes a PI wants a post doc with a lot of potential who is also hungry and hard working. Sometimes a PI wants a post doc with a proven research production stream.