If you fly into Shanghai (and plan to fly out from there as well) and enter on a 144-hour visa exemption, and then take the Train to Beijing to spend the time there, what would the consequences be if checked by the authorities?

Would you be deported from the country, or simply sent back to Shanghai?

How likely is it even that a police officer would ask a Western tourist to go to the hotel with them so they can check the passport?