Williams said: "I tried to stay calm and be more serene after the loss of the first set. I knew it was important for me just to keep trying, just to keep going."
Zall's Brazilian forward Leonardo Baptistao sparked the contest into suspense with a powerful header to convert Li Hang's 67th-minute corner.
Bosnia started the game well and Haris Hajradinovic gave his side the lead with a penalty 24 minutes into the game.
With reigning US Open champion Nadal, who cited concerns about traveling amid the COVID-19 pandemic, and an injury-hit Federer opting out of the event, Djokovic had been favorite to win another title in New York. Enditem
Briton Adam Yates retained the yellow jersey and kept a three-second lead over Jumbo's Primoz Roglic in the overall standings.
"I wanted to go, and I was in my right to do so, because my contract said I was free. I wanted to go because I was thinking about being happy in my last years in football," he commented.
Barty wished the players and the French Federation all the best for a successful tournament and said she was now looking to a long preseason and the summer in Australia.
PP Sports released a statement on Thursday night, claiming the termination was just a "strategic adjustment".
Williams's ambition of securing a record-equaling 24th Grand Slam title remains alive as she moved into the women's quarterfinals after an immensely hard-fought 6-3, 6-7 (6), 6-3 victory over Maria Sakkari of Greece, while Thiem had a much easier time with a 7-6 (4), 6-1, 6-1 win against Canadian rising star Felix Auger-Aliassime in the men's draw.
In an earlier match, Shenzhen edged defending champion Zhejiang 3-2, with both teams of similar strength showing their best from the very beginning.
Looking to hold onto their narrow lead, Slovakia played more defensively in the game's later stages, and were punished for their caution in the first minute of injury-time, when Ilay Elmkies equalized from Yonatan Cohen's through-ball.