  We employ \textit{ab initio} calculations to investigate energetics of point
defects in metastable rocksalt cubic Ta-N and Mo-N. Our results reveal a strong
tendency to off-stoichiometry, i.e. defected structures are predicted to be
more stable than perfect ones with 1:1 metal-to-nitrogen stoichiometry, in
agreement with previous literature reports. While Ta-N significantly favours
metal vacancies, Mo-N exhibits similar energies of formation regardless of the
vacancy type ($V_\text{Mo}$, $V_\text{N}$) as long as their concentration is
below $\approx15\,\text{at.\%}$. The overall lowest energy of formation were
obtained for $\text{Ta}_{0.78}\text{N}$ and $\text{Mo}_{0.91}\text{N}$, which
are hence predicted to be the most stable compositions. To account for various
experimental condition during synthesis, we further evaluated the phase
stability as a function of chemical potential of individual species. The
proposed phase diagrams reveal four stable compositions,
$\text{Mo}_{0.84}\text{N}$, $\text{Mo}_{0.91}\text{N}$, $\text{MoN}_{0.69}$ and
$\text{MoN}_{0.44}$, in the case of Mo-N and nine stable compositions in the
case of Ta-N indicating the crucial role of metal under-stoichiometry, since
$\text{Ta}_{0.75}\text{N}$ and $\text{Ta}_{0.78}\text{N}$ significantly
dominate the diagram. These results are important for understanding and
designing experiments using non-equilibrium deposition techniques. Finally, we
discuss a role of defects ordering and estimate a cubic lattice parameter as a
function of a defect contents.
