Answered by Borut | Jan. 02, 2025 00:19
No, your itinerary is not eligible for 240 hour visa free transit. The essence of 240 hour visa free transit scheme is that your immediate points before and after your visit to mainland China have to be in two different countries or eligible territories. Eligible territories are Hong Kong, Taiwan and Macau.
As you can see see from your itinerary, your both immediate points are in Hong Kong and that is not considered as a transit and consequently you can not use it in 240 hour visa free transit context.
Maybe you could do one creative detail to enable your itinerary for 240 hour visa free transit by inserting Macau instead of Hong Kong for the the segment Shanghai - Hong Kong. As you can see, by taking a flight from Shanghai to Macau, your itinerary would become eligible for 240 hour visa free transit. Also, when you have arrived (landed) in Macau, you can easily and immediately transfer to Hong Kong. I hope you can adapt/alter this segment in order to enjoy 240 hour visa free transit and not to bother yourself with visa in advance formalities. I wish you a pleasant journey.