The prime-minister-in-waiting has apologised for Labour’s response to the violence in Gaza, saying they had ‘didn’t get it right’