A couple things.
One, it is important to remember that the matchup is 9-10 on hard and grass, 2-13 on clay.
Through 2009, the last year Roger was year-end #1, the matchup was 3-3 hard, 2-1 grass (5-4 non-clay), and 2-9 clay, so 7-13 overall...not nearly as bad as the 11-23 it is now, and massively skewed because of what lacatch pointed out, that they were playing most of their matches on clay because Rafa wasn't going as deep in hard and grass tournaments.
If we just look at Roger's absolute peak, through 2007, the matchup was 3-2 hard, 2-0 grass (5-2 non-clay), and 1-6 on clay, or 6-8 overall.
Further, if we take out Roger's bad 2013, the hard match-up is 7-6 to Roger, and 1-1 in their last two hard-court matches. This implies that they're a lot closer on hard than the overall h2h would indicate.
That said, the h2h is what it is and Rafa has owned Roger. But the point is, it isn't so clear-cut as "11-23" would indicate, especially considering the fact that 44% of those matches were on clay. Right now, of the "elite" 14 tournaments, one is grass (7%), nine are hard (64%) and four are clay (29%), meaning their high percentage of clay matches are disproportionate to the actual tournaments played.
If we add in the 13 ATP 500 tournaments, the clay percentage goes down even further:
hard: 17 (63%)
grass: 3 (11%)
clay: 7 (26%)
Might as well add in the 40 ATP 250s:
hard: 37 (55%)
grass: 8 (14%)
clay: 22 (31%)
That brings the clay up a bit more, but it is still disproportionate to the number of matches Rafa and Roger played on clay (44%). It is also worth pointing out that they've never played in an ATP 250 event, and I think only a couple times ATP 500.