In the scenario you describe, rather than Poisson I would read this as $N=300$ independent observations of a binary outcome [pass/fail]. This would mean that your sampling process has a $Y \sim $ Binomial$(N, p)$ distribution, where $p$ is the probability of a failure.
$P(Y \lt 1 | N, p) = (1-p)^N = 0.95$
$N = \ln(0.95)/ \ln (1-p)$
While this is the relationship between sample size and the chance of getting a failure it's not actually very helpful. Because it's easy to imagine that whatever the failure rate, if we take a big enough sample we're almost sure to get a failure. I.e. $P(Y \lt 1 | N, p)$ goes to zero with $N$.
Instead, I suppose you have an idea or an agreement what $p$ should be at most; e.g. say $p=0.01$. If that's the case you could calculate the largest acceptable number of of failures by
qbinom(0.95, 300, 0.01) #6
But this doesn't tell you what sample size to use.
If you want to do a sample size calculation you'd need to additionally specify how accurate you need the estimated proportion $p$ to be. Then you could use the formulae in .