Flat cohomology and Picard groups

Let $(R,m)$ be a local complete intersection of dimension $3$. Let $X=Spec(R)$ and $U=Spec(R) -\{m\}$ be the punctured spectrum of $R$. I am trying to understand the following comment by Gabber (see it here , page 1975-1976):

$Pic(U)$ is torsion-free is equivalent to the flat local cohomology $H_{\{m\}}^2(X, \mu_n)=0$ for $n>0$

So let's try to go through a possible argument (this is from my very limited understanding, so feel free to correct me here). The sequence: $0 \to \mu_n \to {\mathbb G_m} \xrightarrow{t\mapsto t^n} {\mathbb G_m} \to 0$ is exact on the flat site over $U$, $U_{fl}$. Thus the long exact sequence of flat cohomology shows:

$0 \to H^1(U_{fl},\mu_n) \to H^1(U_{fl},{\mathbb G_m}) \xrightarrow{\times n} H^1(U_{fl},{\mathbb G_m})$

We know that $H^1(U_{fl},{\mathbb G_m}) \cong Pic(U)$. Now excision gives:

$H^1(X_{fl},\mu_n) \to H^1(U_{fl},\mu_n) \to H^2_{\{m\}}(X_{fl},\mu_n) \to H^2(X_{fl},\mu_n)$

Obviously $H^1(X_{fl},\mu_n)=0$ (note that $H^1(X_{fl},{\mathbb G_m})\cong Pic(X)=0$, as $R$ is local). EDIT: obviously, it is not true, the argument becomes quite subtle, please see Emerton's answer below.

But why is $H^2(X_{fl},\mu_n) =0$? It is true for curves, but Milne warned against using flat cohomology for higher dimensions in his note on duality theorems (see the first page of Chapter III). In fact, I could not find any reference about flat cohomology in higher dimensions. So:

Can some one help finish/fix the argument above? Is there a reference from which I can quote the facts" I used above?

This is not a complete answer by any means, but is intended to get the ball rolling.

First of all, it need not be the case that $H^1(X_{fl},\mu_n) = 0.$ Rather, what follows from the vanishing of $H^1(X_{fl},{\mathbb G}_m)$ is that $H^1(X_{fl},\mu_n) = R^{\times}/(R^{\times})^n.$

(This is not always trivial; imagine e.g. that $R$ is a non-algebraically closed field. You might have been thinking of the case when $X$ is projective and smooth over an algebraically closed field, when the $H^0$-part of the exact sequence is itself exact, and so can be omitted from consideration. That is not the case here.)

Secondly, this doesn't hurt your arguments, because the same consideration of $H^0$-terms has to be made for the cohomology of $U$. Since $X$ is three dimensional and a complete intersection, restriction induces an isomorphism $H^0(X,\mathcal O) \cong H^0(U,\mathcal O)$, and so also an isomorphism $H^0(X,\mathcal O^{\times})\cong H^0(U,\mathcal O^{\times}),$ and so also isomorphisms $H^0(X_{fl},\mu_n) \cong H^0(U_{fl},\mu_n)$ and $H^0(X_{fl},{\mathbb G}_m)\cong H^0(U_{fl},{\mathbb G}_m).$ Thus in fact one finds that the $n$-torsion in Pic$(U)$ is equal to the cokernel of the injection $H^1(X_{fl},\mu_n) \hookrightarrow H^1(U_{fl},\mu_n).$ And as your analysis shows, this cokernel embeds into $H^2_{\{m\}}(X_{fl},\mu_n)$, with the cokernel of that embedding itself embedding into $H^2(X_{fl},\mu_n).$

Since $H^1(X_{fl},{\mathbb G}_m)$ vanishes, as you observed, one finds that $H^2(X_{fl}, \mu_n)$ coincides with the $n$-torsion in the cohomological Brauer group $H^2(X_{fl},{\mathbb G}_m).$ (Here I am using the fact that since ${\mathbb G}_m$ is smooth, flat and etale cohomology coincide, so $H^2(X_{fl},{\mathbb G}_m) = H^2(X_{et}, {\mathbb G}_m).$) So it seems that one wants to kill off the torsion in this Brauer group.

I don't see why this need be true, but what one actually needs is that $H^2(X_{fl},\mu_n) \rightarrow H^2(U_{fl},\mu_n)$ is injective. Since $H^2(X_{fl},\mu_n)$ embeds into $H^2(X_{fl},{\mathbb G}_m)$, it would be enough to show that the restriction $H^2(X_{fl},{\mathbb G}_m) \to H^2(U_{fl},{\mathbb G}_m)$ induces an injection on torsion. Might this be some kind of purity result on Brauer groups of the kind Gabber discusses in his abstract? It would be related to a vanishing of (torsion in) $H^2_{\{m\}}(X_{fl}, {\mathbb G}_m)$. Somewhere (maybe here?) one presumably has to make use of the dimension and lci hypotheses.

To learn about these kinds of arguments, my advice is to do just what you are doing. One works with the exact sequence linking $\mu_n$ and ${\mathbb G}_m$, as you did.
Number theorists (at least of a certain stripe) have some advantages with this, because the case $X =$ Spec $K$ ($K$ a field) comes up a lot under the name of Kummer theory, and also Mazur in one of his famous papers uses a lot of flat cohomology. But in the end, the formalism is just the one you used in your question.
Then, typically, one has to inject something additional that is less formal. My suggestion would be to look at de Jong's proof of Gabber's result showing $Br'(X) = Br(X)$ discussed in his abstract. (There is a write-up on de Jong's web-page.)