From Timatic it seems like you qualify for transit without visa if your transit time is less than 24 hours:
Transit - China (People's Rep.) (CN)
Visa: Visa required.
TWOV (Transit Without Visa): Holders of confirmed onward air, cruise
or train tickets for a max. transit time of 24 hours. Transit incl.
multiple stops within China (People's Rep.), with a total transit time
of max. 24 hours, is permitted. They must travel to a third country.
Transit without visa (TWOV) is not possible at Fuzhou (FOC), Huangshan (TXN), Mudanjiang (MDG), Shenzhen (SZX) and Yanji (YNJ).
This does not apply at Urumqi (URC).
This does not apply at Guangzhou (CAN).
All transiting passengers are subject to a check by immigration.
Passengers in transit must hold passports or other documents accepted
to enter China (People's Rep.). .