Date: 201911
Local time of day: 0601-1200
Location: ZZZ.Airport, US
Flight conditions: IMC
Weather elements / visibility: Fog
Aircraft: B777-200
Operator: Air Carrier
Operating under: Part 121
Flight plan: IFR
Mission: Passenger
Flight phase: Takeoff / Launch
Airspace: Class B ZZZ
ATC / advisory: TRACON ZZZ
Reporter organization: Air Carrier
Reporter function: Pilot Not Flying; Captain
Reporter qualification: Flight Crew Air Transport Pilot (ATP); Flight Crew Instrument; Flight Crew Multiengine
Human factors: Workload; Time Pressure; Communication Breakdown; Confusion; Distraction; Human-Machine Interface
Anomaly: Deviation - Track / Heading All Types; Deviation / Discrepancy - Procedural Published Material / Policy; Inflight Event / Encounter CFTT / CFIT
Detector: Automation Aircraft Terrain Warning
Result: Flight Crew Regained Aircraft Control; Flight Crew Became Reoriented
Contributing factors: Human Factors
Primary problem: Human Factors

Narrative: First Officer was PF (Pilot Flying). Captain was PM (Pilot Monitoring). The departure clearance was changed via CPDLC (Controller Pilot Data Link Communications) during taxi-out. [The first] SID was changed to [the second] SID after all briefings were complete for [the first SID]. I loaded the new route into the FMC from the CPDLC prompt. I failed to load the [second] departure into the FMC from the App/Dep Page. We briefed the [second SID] and I put a 4 NM ring around the ZZZ VOR in the FIX page to comply with the crossing altitude restrictions. Heading 296 was selected on the MCP (Mode Control Panel) and 2;000 in the altitude window. This was the completely wrong way to program this SID into FMC for the 'climb via' clearance. There would have been no deviation if I had deselected LNAV for the takeoff during the MCP setup. The FO (First Officer) hand flew the departure. At 500 feet the FO entered a right turn following the Flight Director guidance to waypoint ZZZZZ. This occurred during gear retraction and frequency change to [Departure]. I announced 'Runway heading! Runway heading!' FO turned back left to 296 degrees. FO had turned right about 30 degrees before correcting back to the left. We got a GPWS 'Bank Angle' alert during the left heading correction back to 296 degrees. I did not determine the maximum bank angle. There were no other GPWS alerts. Frequency change and climb with [Departure] were uneventful. There was no query by Departure.I don't even know where to start. There were multiple distractions during taxi out. The visibility began to decrease about 5 minutes before pushback. We were number 8 for takeoff and [Departure] held all departures for 15 minutes. I had initially started both engines before tower announced the ground hold. I shut down the right engine because I didn't know how long we would be delayed. In the end; I waited too late to start the right engine the second time. The CPDLC departure clearance change came late about the time I needed to start the engine. The new routing was confusing. I rushed through the FMC programming and failed to load the SID from the App/Dep Page. I questioned the 'climb via' clearance and the crossing restriction at the [second SID] DME. That became my focus. We had no shared mental model even though we discussed in detail the initial climb heading and altitude constraints. I built the initial climb for the [second] SID in the FIX page instead of loading from the FMC. The FO did not realize that I had not loaded the [second] SID in the FMC. I failed to cross check the FMA's before takeoff and during the checklist to ensure that the aircraft would track 296 degrees.I will slow down and make sure there is a shared understanding of the departure clearance and SID especially after a route change. I will load the FMC after a route change with the same steps as the initial setup. I will make sure the new route is understood thoroughly; programmed correctly; and briefed. I will slow down and cross check FMA's several times during a high distraction event. I have gone over and over the distractions that led up to the event. The significant end result was exceeding bank angle and causing a GPWS alert.




Synopsis: B777 Captain reported incorrectly programming the departure; which resulted in a wrong direction turn and a GPWS alert during initial climbout.