fix(optimizer): close custom extension analysis bundles (#23207)