The number of low-energy constants (LECs) in chiral effective field theory ($\chi$EFT) grows rapidly with increasing chiral order, necessitating the use of Markov chain Monte Carlo techniques for sampling their posterior probability density function. For this we introduce a Hamiltonian Monte Carlo (HMC) algorithm and sample the LEC posterior up to next-to-next-to-leading order (NNLO) in the two-nucleon sector of $\chi$EFT. We find that the sampling efficiency of HMC is three to six times higher compared to an affine-invariant sampling algorithm. We analyze the empirical coverage probability and validate that the NNLO model yields predictions for two-nucleon scattering data with largely reliable credible intervals, provided that one ignores the leading order EFT expansion parameter when inferring the variance of the truncation error. We also find that the NNLO truncation error dominates the error budget.