Given you are making only a half-day trip to Manila, it sounds like your ticket back to Budapest seems to put you just over the 144-hour limit.
Are you aware that in calculating the 144-hour limit at Shanghai, you ignore the time elapsed on your day of arrival? That is, you start calculating the 144 hours starting from 0:00 the day after you arrive.