I am not qualified to answer whether the spike protein is identical to the one in the virus, but from what I understand it is very close. The protein just doesn't have the virus attached. It's like having a factory manufacturing car door handles but no cars.
Things could go wrong, mostly because some folks may have allergic reactions, autoimmune flare ups, or the increased immune response can cause side effects like Bell's palsy. That said, mRNA breaks down quickly on its own, and the spike proteins will be cleaned up quickly. The odds of a serious complication are very, very, very, very low from the studies performed so far. (Expect some flu like symptoms, however, as your body fights the cells with the modified RNA.)
I'm a total layperson here, just synthesizing what I've read.