Reinforcement learning: understanding this derivation of n-step Tree Backup algorithm
The slides and the book are consistent. Notice how in the slides there is a restriction in the summatory: i.e.  $a \neq A_{t+1}$. For $G^{(2)}$, you need to "remove" from $V_{t+1}$ the term that should not be there, i.e. $A_{t+1}$. 

Now, why this term is removed?

If you keep this term you will be adding $A_{t+1}$ twice. In 1-step backup, it is part of the expectation of step $S_{t+1}$. 

When you calculate 2-step backup you want to replace $(S_{t+1}, A_{t+1})$ in the 1-step expectation with the discounted expected value of $S_{t+2}$.
So you substract the term and add the discounted expectation for $S_{t+2}$