Why did Qatar Airways Flight 968 drop from radar and go on an erratic path?

Qatar Airways flight #968 from Doha, Qatar, to Hanoi, Vietnam, declared an emergency when approaching Hanoi on today’s scheduled flight. After this, the  Boeing 787 Dreamliner went on an erratic flight path.

According to information recorded on Flight Aware, the aircraft turned around, left Vietnam and went back into Thailand air space. The flight did not approach the kingdom’s largest airport Bangkok, but landed in Chiang Mai, Thailand.

eTN Chatroom: Discuss with readers from around the world:

Looking at flight details on the website, it shows the plane 5 1/2 hours into the flight rapidly dropping from an altitude of 40,000 feet to 10,000 feet and then over the next half hour down to almost ground level while approaching Hanoi,  then back up to where it sustained a low level of around 3,000 feet for several minutes before climbing back up to 35,000 feet and then coming back down approximately an hour later on it’s approach to Chiang Mai.

The aircraft safely navigated to gate 7 where it is now parked and passengers are disembarking.

There is speculation that the aircraft may have faced an emergency due to the weather.

Flight 968 took off at 9:13 pm from Doha and was scheduled to land in Hanoi at 9:30 am local time.

Qatar Airways issued the following statement to eTN:
Due to poor weather conditions and low visibility impacting operations in Hanoi, Qatar Airways flight QR968 from Doha to Hanoi diverted to Chiang Mai. As instructed by local ATC, the crew squawked the emergency code 7700 during the diversion. Upon arrival in Chang Mai, all passengers were kept fully updated with regards to the new departure time.

Those who had onward connections were assisted on an individual basis to ensure smooth onward connections to their final destinations. The safety, comfort, and wellbeing of our passengers and crew remains our utmost priority at all times.

Flight 968 took off at 9:13 pm from Doha and was scheduled to land in Hanoi at 9:30 am local time.