Is the following argument valid?

> God is by definition is perfect. Non-existence would be an imperfection, therefore God exists. 

Something seems a bit off with the argument. For example, one could say,

> I define a monster to be the scariest possible being. A monster would be scarier if it exists and is about to attack me. Therefore, I am about to be attacked by a terrifying monster.

This is clearly false. Is there something fundamentally different between these two arguemnts? If not, then why are they invalid?