Wettability impacts residual trapping of immiscible fluids during cyclic injection