Folic acid would be my biggest concern (folate deficiency is a major cause of spinal and brain related birth defects).
Prenatal vitamins contain folic acid, but I wouldn't think that it could entirely replace the need to get folates and other nutruents from actual fruits and vegetables.
There are a lot of nutrients we don't fully understand, some of which probably haven't even been discovered yet.
Meal replacements and dietary supplements like Optifast shakes and vitamin pills contain only the nutrients we know about, so eating as wide a variety of foods as possible (within your doctor-approved calorie limit) is a much better strategy, because it gives you a better chance of getting everything you need.
It isn't what's in Optifast that's the problem for pregnancy, it's what isn't in it.
Also, this really isn't the best place to get your question adequately answered considering you can't guarantee that any of us know what we're talking about. You need to get the opinion of actual experts such as your ob/gyn and possibly a prenatal dietician.