Hi Dominik,
I understand that you are running the same code on the same version of MATLAB 2020b on two architectures, Jenkins and a local machine, and getting different answers. Unfortunately, the Math Kernel Library (MKL) that ships with MATLAB is architecture-dependent to optimize the architectures' resources when possible (multi-threading, etc.). This is good for performance but can result in the phenoma you describe above. Therefore, two different machines running the same version of MATLAB can call their respective MKLs and get answers with minor differences.
As most optimization algorithms are inherently iterative, these minor differences can propogate and become major differences over many iterations. This is why your results match for the first few iterations before they diverge in later iterations. If an optimization problem has multiple minima, these differences can sometimes cause optimization algorithms to converge to distinct minimizers resulting in substantially different valid answers.
Best Answer