Answered by ZUPAN | Dec. 15, 2019 05:29
Yes, unfortunately, your itinerary requires a Chinese tourist (L) visa because of this segment:
Thailand - Shanghai - Thailand
As you can see there is no third country, but this is a simple round trip ticket.
The only way how you can escape from obtaining a visa is to book a trip to some nearby destination in Japan or South Korea, Jeju for example through Spring Airlines or some other low cost airline. If you do this, then your itinerary will be:
Thailand - Shanghai - South Korea
South Korea - Shanghai - Thailand
This is eligible for 24 or 144 hour visa free transit and this option does not require a visa.
Anyway, since you have allocated just 3 days for Shanghai, if you do this trip to avoid visa, you will not be able to see anything from both destinations. In reality, you will be doing the transfers all the time. More in the airports and planes than at the destinations you have planned to visit.
If you have only booked your itinerary to look like:
Thailand - Shanghai - Hong Kong - Thailand
That would be great. Now, it is a bit too late for that especially if you cannot change your flight tickets.