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".
- Movie studios join Disney-led service to link digital purchases
- Aarushi Talwar-Hemraj Murder: Timeline of Case so Far
- Longmont's Wibby Brewing wins in love and lager
- Japan's Kobe Steel under fire for fudging data on metals
- Police arrest one accused of Odia techie murder case in Bengaluru
- Google will 'permanently remove' Home Mini feature that led to constant recording
- Kenyan opposition candidate approved for poll after challenger withdraws
- Radamel Falcao Denies Colombia 'Pact' with Peru in World Cup Qualifier
- Pre-Market Movers - Hewlett Packard Enterprise Company (NYSE:HPE)
- Anthony Martial 'Happy' To Reject Arsenal