Will an off-topic Masters hurt my chances of a PhD place?
Don't ask us.

Contact your favourite three prospective universities for your cosmology PhD. Better still, contact your favourite three supervisors for your cosmology PhD. Ask them:


What Master's dissertation topic will prepare me best for my intended cosmology studies?
What Master's dissertation topic will make me most likely to be successful when applying to study a cosmology PhD?


(The first question is much more interesting than the second).

You will find enthusiasm for engaging with your question and your situation, because you are expressing specific interest in their field and because you are not asking them to decide anything about your application – since you have not applied. Quite a lot of people in senior levels in cosmology are interested in cosmology and are glad to find interest in cosmology in other people.