New method improves the accuracy of machine-learned potentials for simulating catalysts