It's generally accepted that if a shot was on target but then deflected from another team's player and went in, then the goal is not considered as an own goal. "Generally accepted", because there are no official rules regulating these scenarios.
But what about Sergio Ramos's 2nd goal in Napoli vs Real Madrid, Round of 16, 2nd leg, 2016/17 Champions League game (Europe video) (US video)? This goal was accounted by UEFA as Dris Mertens's own goal, although the shot was clearly on target.
The only guess I have is that as this shot was directed towards the goalkeeper Pepe Reina, the guys who define the authorship of the goals decided that if there hasn't been a deflection, Reina would have easily caught the ball. So, why this goal is counted as an own goal?