Iranian president’s apology showcases rifts among the country’s leaders.