The Australian has been fined £7,500 and has lost £16,000 in prize money for unsporting conduct as he walked off the court after losing a first-set tiebreak to the American during the opening-round match.
Kyrgios later apologised for his behaviour, posting a statement on social media in which he said his retirement was due to illness.
As the player exited the arena in Shanghai, a member of Kyrgios's coaching team said the world-ranked 21 had injured his shoulder.
"I've been battling a stomach bug for the last 24 hours and I tried to be ready but I was really struggling on the court today, which I think was pretty evident from the first point".
The temperamental Kyrgios did look in discomfort with his shoulder early on in the match against the unseeded Johnson.
But Schwartzman cut the 185cm Federer down to size and an unusually error-strewn performance from Federer was summed up when he squandered an easy backhand volley at the net to go to the first-set tie break, which the Swiss eventually won 7/4.
"What's happening here?" he was overheard saying, seemingly irritated by spectators moving around between. He left the court without explanation, avoided a news conference, and took to Twitter to firstly apologize for his actions then give his reasons. If you don't like it, I didn't ask you to come watch.
Kyrgios, who had gone up 3-0 in the tie-break, appeared to blame the umpire for failing to get the spectators in line and his afternoon spiralled fast when he received a point penalty.
Meanwhile, Kyrgios has been confirmed to play at the Brisbane International.
"Poor officiating again", Kyrgios then complained, and added: "Sick of this place". Last year Kyrgios was suspended and fined more than USD50,000 for a freaky outburst which saw him throw a 6-3 6-1 match against German Mischa Sverev while asking an umpire, "Can you call time so I can finish this match and go home?" "I'll do what I can to make sure I do".
- Sells 418 Shares of EOG Resources Inc (EOG)
- Reliance Jio's new plan offers 100 per cent cashback on Rs 399
- Palace distances self from SC ruling to keep De Lima in jail
- Karan Johar announces new movie Brahmastra starring BigB, Ranbir and Alia
- British IS recruiter Sally-Anne Jones 'killed in air strike'
- Anthony Martial 'Happy' To Reject Arsenal
- Hamas, Fatah reach Palestinian reconciliation deal
- Aarushi Talwar-Hemraj Murder: Timeline of Case so Far
- Trump again blasts Iran nuke deal as certification decision looms
- Dani Alves urges Alexis Sanchez to join him at Paris Saint-Germain