The logic used to add missing dihedrals isn't reproducible since it uses Connectivity::findPath to find dihedrals between 1-4 atoms. If there are multiple paths of length 4, then a random path will be returned. The code should be updated to add dihedrals for all four atom paths using Connectivity::findPaths, as well as sorting the result of findPath to ensure that it is reproducible for the same input.