Djokovic, who was returning to the ATP Tour after an elbow injury ended his Australian Open challenge prematurely in January, crashed to a 7-6, 4-6, 6-1 defeat against the world number 109 Taro Daniel in the second round of the BNP Paribas Open.
The loss was just the fifth time in his career that the Serb has been defeated by a player outside the top 100 in the rankings.
Federer meanwhile, had little trouble against Argentina’s Federico Delbonis – winning in straight sets 6-3, 7-6 (8-6).
The match had been carried over from Saturday after rain suspended play.
The Swiss legend, who regained the No 1 spot last month, is hoping to complete the ‘Sunshine Double’ of Indian Wells and Miami Open for the fourth time in his career.
Djokovic, a 12-times Grand Slam champion, has been plagued by injuries over the past 18 months.
And while conceding he’s not surprised to see his rival struggle to get back to his best, he admits he does sympathise with him.
He said: “It’s not unusual what’s been happening to Nole.
“It takes extra effort to manage the playing situations.
“I see where he is coming from, I know how he feels, it may be difficult for you to hear from a champion that he is having those days.”