Going further into what Psycho Gecko said, I think the body definitely would affect the mind/personality. On a biochemical level, cis men and cis women are quite different (I've never read a study about the biochemistry of non-binary gendered people, and I think it would be fascinating).
In my serial, one character changes gender (not a body swap, uncontrolled super power), and she has to deal with now being male, with the suddenly massively ramped up levels of male hormones and the suppressed levels of female hormones.
Looking into how this actually works, I was pretty surprised to find that the same hormone can actually have a different affect on people according to their gender. For instance, oxytocin (which is generally accepted as the chemical reason people fall in love) has a different affect on men and women.
High levels of oxytocin in women make them friendlier, whilst high levels of oxytocin in men make them more competitive.
So if you're looking at the body swap possibility, consider that the body can (probably does) affect the personality.
(If you're dying reincarnation, they'd grow up with the new body, go through puberty, and the hormone levels would increase at a more natural rate, so this would have less of an effect).