Connecting a capacitor to a voltage source is invalid because you can't change it's voltage instantly. You could add some internal resistance to the source to fix the error. Keep in mind that the circuit still doesn't make much sense. To model a transformer with parasitic elements you should consider expanding your model to a more elaborate state. The "Mutual Inductance" block in PLECS might give you a place to start.