fix(core): finalize chain-group runs on `BaseException` (#39699)