Hello,
I guess the mistake is that in the iterated expectations, you have , where Y is a random variable, and not an event. And X has to be a random variable too.
Here, is indeed a random variable. But A is defined as an event.
A few facts :
X|A is a random variable. E(X|A) is a number.
X|Y is a random variable. E(X|Y) is a random variable. E(E(X|Y)) is a number.