We studied coherent beam combining in a specific laser cavity architecture in which two Ytterbium-doped fiber amplifiers are passively coupled using a homemade binary phase Dammann grating. Our experimental results show that coherent beam combining is robust against phase perturbation in such a laser cavity architecture when the operating point is sufficiently above the lasing threshold. We observed redistribution of energy within the supermode of this laser cavity in response to an externally applied path length error. The energy redistribution is accompanied by an internal differential phase shift between the coherently coupled gain arms. Self-phasing mitigates or even completely neutralizes the externally applied optical path length error. We identify the physical origin of the observed self-phasing with the resonant (gain related) nonlinearity in the gain elements under our experimental conditions.