Surely your experience had an impact on how you feel about your body. However, given what you say, it seems that you knew before this experience that you were not a cis woman, and after what happened your feelings only became stronger and harder to bear. If your awareness of not being cis was there before, chances are that you are actually trans. But you have a lot of mixed and intense feelings in your mind right now, probably a therapist would be of help in sorting them out and helping you cope with what happened. After you have coped and elaborated your experience, you'll be able to see more clearly through your feelings, and deal with your gender identity without being conditioned by other factors. If you really are trans, as your words suggest, you might want to deal with one thing at a time and elaborate your loss, so after that you can focus with a clearer mind on who you are and what your path will be.
Related Questions: I recently lost a pregnancy. I know I’m not a cis female but lately it’s made my issues with that get out of control. Could I be trans or could the increased hatred of my body be from pregnancy loss?