For the rest of the post, we'll assume when I say "die" or "dice" that I mean a standard 6-sided die or some number of standard 6-sided dice. Suppose I roll a die and get a number $n$, and then I roll $n$ dice which sum to $m$. What's the mean and variance of $m$?
It seems clear that mean should be $(\frac{7}{2})^2$: there's a 1 in 6 chance of rolling $k$ dice, and the mean of the total roll from a roll of $k$ dice is $\frac72k$, so summing $\frac{7}{12}k$ over all values of $k$ gives $(\frac{7}{2})^2$. This is confirmed by a simulation I ran on a computer.
The variance is less clear to me. I know that when we roll $k$ dice, the variance of this process is $\frac{35}{12}k$. With $m$ as in the first paragraph, $Var(m)=E(m^2)-E(m)^2$, and we know what $E(m)^2$ is by the above paragraph, so it's enough to figure out what $E(m^2)$ is.
Then it seems like $E(m^2)=\sum_{i=1}^6 \frac{1}{6} E(m^2|n=i) = \sum_{i=1}^6 Var(m^2|n=i) + E(m|n=i)^2$ should hold, but just pluggin in $Var(m^2|n=i)=\frac{35}{12}i$ and $E(m|n=i)=\frac{7}{2}i$ disagrees with my experimental results, so something is probably wrong here. What's the correct way to calculate this variance?
You might want to use the law of total variance
Alternatively, taking something similar to your approach:
But you do not know $n$, so