  Cosmological analyses of samples of photometrically-identified Type Ia
supernovae (SNe Ia) depend on understanding the effects of 'contamination' from
core-collapse and peculiar SN Ia events. We employ a rigorous analysis on
state-of-the-art simulations of photometrically identified SN Ia samples and
determine cosmological biases due to such 'non-Ia' contamination in the Dark
Energy Survey (DES) 5-year SN sample. As part of the analysis, we test on our
DES simulations the performance of SuperNNova, a photometric SN classifier
based on recurrent neural networks. Depending on the choice of non-Ia SN models
in both the simulated data sample and training sample, contamination ranges
from 0.8-3.5 %, with the efficiency of the classification from 97.7-99.5 %.
Using the Bayesian Estimation Applied to Multiple Species (BEAMS) framework and
its extension 'BEAMS with Bias Correction' (BBC), we produce a redshift-binned
Hubble diagram marginalised over contamination and corrected for selection
effects and we use it to constrain the dark energy equation-of-state, $w$.
Assuming a flat universe with Gaussian $\Omega_M$ prior of $0.311\pm0.010$, we
show that biases on $w$ are $<0.008$ when using SuperNNova and accounting for a
wide range of non-Ia SN models in the simulations. Systematic uncertainties
associated with contamination are estimated to be at most $\sigma_{w,
\mathrm{syst}}=0.004$. This compares to an expected statistical uncertainty of
$\sigma_{w,\mathrm{stat}}=0.039$ for the DES-SN sample, thus showing that
contamination is not a limiting uncertainty in our analysis. We also measure
biases due to contamination on $w_0$ and $w_a$ (assuming a flat universe), and
find these to be $<$0.009 in $w_0$ and $<$0.108 in $w_a$, hence 5 to 10 times
smaller than the statistical uncertainties expected from the DES-SN sample.
