The correct exact two-sided 95% confidence interval $[\lambda^{-},\lambda^{+}]$ is computed from an observation $x$ of a Poisson variable $X$ using the defining relationships
$$\Pr(X\lt x;\lambda^{-}) = \alpha/2$$
and
$$\Pr(X \gt x; \lambda^{+}) = 1 - \alpha/2.$$
We may find these limits by exploiting
$$e^{-\lambda}\sum_{i=0}^{x}\frac{\lambda^i}{i!} = F_{\text{Poisson}}(x;\lambda) = 1 - F_\Gamma(\lambda;x+1) = \frac{1}{x!}\int_\lambda^\infty t^x e^{-t}\,\mathrm{d}t$$
for natural numbers $x.$
(You can prove this inductively via repeated integrations by parts on the right hand side or you can observe that the left probability is the chance of observing $x$ or fewer points in a homogeneous, unit-rate Poisson process running for time $\lambda;$ while the right probability is the chance that its takes more than $\lambda$ time to observe the $x+1^\text{st}$ point -- which obviously is the same event.)
Thus, writing $G=F_\Gamma^{-1}$ for the Gamma quantile function, the confidence interval is
$$\left[G(\alpha/2;x), G(1-\alpha/2;x+1)\right].$$
The discreteness in the defining inequalities -- that is, the distinction between "$\lt$" and "$\le$" -- is to blame for the apparent inconsistency with the p-value. Indeed, in most circumstances replacing the lower limit by $G(\alpha/2,x+1)$ actually gives better coverage, as simulations show. Here, for instance, are simulations in R
that estimate the coverages of these two procedures.
f <- function(x, alpha=0.05) qgamma(c(alpha/2, 1-alpha/2), c(x, x+1))
z <- 10
x <- matrix(rpois(2e6, f(z)), 2)
mean(x[1,] <= z & z <= x[2,])
The output, which is identical to that of poisson.test
, will be close to 97.7% coverage. The altered interval is
f. <- function(x, alpha=0.05) qgamma(c(alpha/2, 1-alpha/2), x+1)
x <- matrix(rpois(2e6, f.(z)), 2)
mean(x[1,] <= z & z <= x[2,])
The output will be close to 96.3% coverage -- closer to the nominal 95% level.
The problem with this somewhat ad hoc modification is that it fails when the true rate is tiny. In the same simulation with a true rate of $1/10$ rather than $10,$ the coverage of the correct interval is around 98% but that of the modified interval is only 94.4%. If your objective is to achieve 95% or higher coverage--not going any lower--than this is unacceptable. For many applications, especially when very small values of the parameter are highly unlikely, the modified interval has much to recommend it and will produce results more consistent with the p value.
Reference
Hahn, GJ and WQ Meeker, Statistical Intervals. Wiley 1991.
Their formula (7.1), expressed in terms of quantiles of chi-squared distributions, is equivalent to the one I give in terms of Gamma distributions. (Chi-squared distributions with $2x$ degrees of freedom are scaled versions of Gamma distributions with $x$ degrees of freedom.)