Constructing a context-free grammar
Your grammar doesn't seem to generate $caac$. Indeed, in order to generate this work, a simple case analysis shows that the derivation must start
$$ S \to cYc \to caYYc, $$
at which point it is clear that we cannot generate $caac$.
I assume you know how to generate the language $c\Sigma^*c$, as well as the language of all words with an equal number of $a$-s and $b$-s. Instead of combining them in a complicated way, write grammars for both, and then join them together using a rule of the sort $S \to S_1 \cup S_2$.