Do you have any visa for China?
Return flights to shanghai with BA are not eligible for transit without visa as you are not flying A-B-C as per the transit without visa rules. However if you add on the Japan trip then you would be as for the purpose of TWOV you would be:
LHR-PVG-Japan (any airport) shanghai port offers 72/144 hour transits.