I don't have an answer, but I can say that I am having the same problem with my wife's phone, which is stock ROM and has never been rooted. The problem occurred a few times, then the phone would not recognize the SD card at all. After trying other SD cards (still didn't recognize) and trying her SD card in my phone and laptop (worked fine), I did a master reset. Still a no go. I contacted HTC and ended reflashing the stock ROM. Still didn't work.
HTC said if the reflash didn't work that my SD card problem was hardware related. I ordered a new SD/SIM card ribbon and just installed it tonight. The phone immediately recognized the old SD card no problem, but when I tried to take a picture using the side camera button the SD card unmounted itself. I re-mounted the SD card and then tried taking a picture using only screen controls and the phone shut off and had to have the battery pulled in order to power back up. I'm convinced this problem is related to the SD card problem.
I wish I had an answer, but I wanted to add the information in case it was helpful to someone who might.