I'm working on a problem about the estimator $T(X_1,...,X_n)=\overline{X}^2-\frac{1}{n}\overline{X}$ where $X_1,...,X_n$ is an i.i.d. sample from the poisson distribution with paramater $\lambda$. I must prove that $T$ is unbiased for $\lambda^2$ and therefore I've decided to calculate it's expected value. I've come this far: $$ \begin{split} \mathbb{E}_\theta\left[T(X_1,...,X_n)\right]&= \mathbb{E}_\theta\left[\overline{X}^2 - \frac{1}{n}\overline{X}\right]\\ &=\mathbb{E}_\theta\left[\overline{X}^2\right] - \frac{1}{n}\mathbb{E}_\theta\left[\overline{X}\right]\\ &=\mathbb{E}_\theta\left[\left(\frac{1}{n}\sum_{i=1}^n X_i\right)^2\right] - \frac{1}{n}\mathbb{E}_\theta\left[\frac{1}{n}\sum_{i=1}^n X_i\right]\\ &=\frac{1}{n^2}\mathbb{E}_\theta\left[\left(\sum_{i=1}^n X_i\right)^2\right] - \frac{1}{n^2}\sum_{i=1}^n\mathbb{E}_\theta\left[X_i\right]\\ &=\frac{1}{n^2}\left(n\cdot\mathbb{E}_\theta\left[X_1\right]\right)^2 - \frac{1}{n^2}\sum_{i=1}^n\mathbb{E}_\theta\left[X_i\right]\\ &=\lambda^2-\frac{1}{n}\lambda\neq\lambda^2 \end{split}$$
Have I done something wrong? Is the exercise wrong?
The exercise is correct. As Clarinetest says in a comment, your error seems to be with $\frac{1}{n^2}\mathbb{E}_\theta\left[\left(\sum_{i=1}^n X_i\right)^2\right]$ i.e. with $\mathbb E[\bar{X}^2]$.
You should have $\mathbb E[X_1 \mid \lambda]=\lambda$ and $\operatorname{Var}(X_1 \mid \lambda) = \lambda$ for a Poisson distribution
so $\mathbb E[\bar{X} \mid \lambda]=\lambda$ and $\operatorname{Var}(\bar{X} \mid \lambda) = \frac1n\lambda$
leading to $\mathbb E[\bar{X}^2 \mid \lambda]=\lambda^2+ \frac1n\lambda$
and thus $\mathbb E[\bar{X}^2 - \frac1n\bar{X} \mid \lambda]=\lambda^2$