I think it's going to depend a lot on the specifics of the field that you are switching to. You're actually doing a bit of a surprising direction of shift---I've known a number of people who made radical shifts in the opposite direction, from highly unrelated fields into synthetic biology, which works pretty well because it's a young and rapidly expanding field, both inside and outside of academia. Cosmology, on the other hand, is much older, not particularly growing (to the best of my knowledge), and without a large non-academia research sector, so it may be significantly harder to transfer into that field.
That said, if you're going to transfer, postdoc is the right time for "retraining." The key question is to look at the skills you have, and try to figure out how they can be remapped into something "close enough" that it will give you a chance to shift. You might want to consider looking at ESA or NASA, who have both cosmology and biology and where they may be close enough to help move from one to the other. If you do the shift, you should also expect a fairly long period of postdoc, probably multiple postdocs, while you retrain and build credibility for your new field.
Finally, speaking as a synthetic biologist, I might urge you to consider that your view of the field may currently be quite limited. Synthetic biology is an extremely wild frontier with a lot of things you might be interested in. Are you sure you are tired of the field and the wetlab, or are you just tired of your particular lab and how it uses its wetlab people? There is a wide variety of labs and cultures out there, along with a lot of non-lab companies with good positions for people with prior lab experience. Unfortunately some academic labs have rather toxic cultures and treat their graduate students like underpaid lab techs, rather than investigators in training: if this has been your experience and what's driving you out of the field, consider that it may be much better elsewhere.