に先立って => before; prior to ~ N2
に[先立「さきだ」]って/に[先立「さきだ」]ち/に[先立「さきだ」]つ => Before A occurs/takes place N2
Time, Situation
~ひょうしに(~拍子に)   => the moment [A], unintentionally / inadvertently caused something to happen N1