For a sheaf $F$ on $X$ and subspace $Z \hookrightarrow X$, why is $\mathbf{R}\Gamma(Z, F)$ possibly different from $\mathbf{R}\Gamma(Z,F|_Z)$? In Remark 2.6.9 of Sheaves on Manifolds, Kashiwara and Schapira state that for $i: Z \hookrightarrow X$ a subspace of $X$, and $F$ a sheaf on $X$, that $R\Gamma(Z;F)$ may be different from the functor $R\Gamma(Z; -)$ applied to $F|_Z := i^{-1}F$.
Here, $F \mapsto R\Gamma(Z; F)$ is the right derived functor of $F \mapsto \Gamma(Z; F) := \Gamma(Z; F|_Z)$.
They go on to state that there is a natural isomorphism $R\Gamma(Z; F) \cong R\Gamma(Z; F|_Z)$ in certain situations, such as 
1) $Z$ open, 
2) $X$ Hausdorff and $Z$ compact,
3) $Z$ closed in a a paracompact open subset $U$ of $X$.
I am confused because these two functors look like they should be the same. After all $i^{-1}$, being an inverse image, is exact and hence descends to the derived category (as stated a few pages earlier on page 109). So it seems to me that in both cases we are dealing with the functor
$$R\Gamma(Z; i^{-1}(-))=R(\Gamma(Z; -) \circ i^{-1}) \cong R\Gamma(Z; -) \circ i^{-1}.$$ 
Can someone explain what is meant by this Remark, and what is wrong with my reasoning?
 A: Let me expend a bit on what I said in the comments.
The phenomenon in the question is a quite subtle point in homological algebra. Derived functors does not always compose very well, even if one of them is exact. More precisely, let $\mathcal{A}\overset{F}\rightarrow\mathcal{B}\overset{G}\rightarrow\mathcal{C}$ be left exact functors between abelian categories. Then, $R(G\circ F)$ is not always $RG\circ RF$. Even under the assumption that $F$ is exact.
Let us assume that $F$ is exact. Then to compute $R^i(G\circ F)(X)$, we need an injective resolution $X\rightarrow I^\bullet$. Then we apply $G\circ F$ to $I^\bullet$ and finally take the $i$-th cohomology.
The thing is, $F(I^\bullet)$ is indeed a resolution of $F(X)$ (because $F$ is exact), but is often no more composed of injective objects, and might even contains objects that are not $G$-acyclic. This means that this resolution cannot be used to compute $RG(F(X))$.
For example, if $i>0$ and $I$ is an injective object, then $R^i(G\circ F)(I)=0$ (every derived functor vanishes on injectives). But $F(I)$ might not be $G$-acyclic. So $R^iG(F(I))$ might be non zero.

Yes this is a subtle point, because exact functors are not always obvious. Here are some examples.
As in your post, if $i:Z\rightarrow X$ is the inclusion of an arbitrary subspace and $F$ a sheaf on $X$, there are ambiguities in the definition of $H^i(Z,F)$. It can mean the derived functor of $\Gamma\circ i^{-1}$, or $H^i(Z,F_{|Z})$. And there are some cases where these functors differ. While I am writting this, I realize that I kind of disagree with the definition of Kashiwara-Shapira. I may be tempted to say that the good one is the latter. Indeed, with $F=\mathbb{Z}$ the constant sheaf on $X$, I would say that $H^i(Z,\mathbb{Z})$ should be $H^i(Z,F_{|Z})$ while the former $R^i(\Gamma\circ i^{-1})(\mathbb{Z})$ might depends on (a neighborhood of $Z$ in) $X$.
As I said in the comments, in étale cohomology we define $\Gamma_c$ to be the functor $\Gamma\circ j_!$ where $j:X\rightarrow \overline{X}$ is any compactification. The functor $j_!$ is exact, but the two functors $R\Gamma\circ j_!$ and $R(\Gamma\circ j_!)$ are really differents. This is the former that gives the good results and which is denoted $R\Gamma_c$, the latter being ill-behaved. In particular, there are injective sheaves where $H^i_c(X,I)\neq 0$.

Sometimes however it works. Here are two examples. 
If $i:Z\rightarrow X$ is the inclusion of a closed subset, the functor $i_*$ is exact. And in this particular case $R(\Gamma\circ i_*)$ is indeed isomorphic to $R\Gamma\circ i_*$. This leads to the well-known and heavily used formula $H^k(X,i_*F)=H^k(Z,F)$. Here it works because $i_*$ preserve injective (because its left adjoint $i^{-1}$ is exact).
Another subtle example : let $X$ be a scheme. There are a priori two definitions for $H^i(X,F)$ for $F$ a quasi-coherent sheaf, depending on the category we are working in : $QCoh(X)$ the category of quasi-coherent sheaves on $X$ or $Sh(X)$. Let $U:QCoh(X)\rightarrow Sh(X)$ be the inclusion functor. Then we want to be sure that $R\Gamma\circ U$ and $R(\Gamma\circ U)$ are the same. In this case, $U$ does not preserve injective (take $X=\operatorname{Spec}\mathbb{F}_p$). However, injective quasi-coherent sheaves are flabby, and sheaf cohomology can be computed using flabby sheaves.
I find this last example really subtle (and thankfully there are nothing to worry). But $U$ is never written in practice, so there would be lots of confusions if it did not send injective to acyclics...
