We investigate the Berezinskii-Kosterlitz-Thouless (BKT) scaling of the critical current of Josephson junction dynamics across a barrier potential in a two-dimensional Bose gas, motivated by recent experiments by Luick et al. [Science 369, 89 (2020)]. Using classical-field dynamics, we determine the dynamical regimes of this system as a function of temperature and barrier height. As a central observable we determine the current-phase relation as a defining property of these regimes. In addition to the ideal junction regime, we find a multimode regime, a second-harmonic regime, and an overdamped regime. For the ideal junction regime, we derive an analytical estimate for the critical current, which predicts the BKT scaling. We demonstrate this scaling behavior numerically for varying system sizes. The estimates of the critical current show excellent agreement with the numerical simulations and the experiments. Furthermore, we show that the damping of the supercurrent is associated with the phonon excitations in the bulk, and the nucleation of vortex-antivortex pairs in the junction.