Impact of decoherence on the fidelity of quantum gates leaving the computational subspace