Date: 201807
Local time of day: 0001-0600
Location: ZZZ.Airport, US
Flight conditions: VMC
Weather elements / visibility: 5
Light: Daylight
Aircraft: B747-400
Operator: Air Carrier
Operating under: Part 121
Flight plan: IFR
Mission: Cargo / Freight / Delivery
Flight phase: Takeoff / Launch
Airspace: Class C ZZZ
ATC / advisory: TRACON ZZZ
Reporter organization: Air Carrier
Reporter function: Pilot Flying; First Officer
Reporter qualification: Flight Crew Instrument; Flight Crew Air Transport Pilot (ATP); Flight Crew Multiengine
Human factors: Situational Awareness; Human-Machine Interface; Confusion; Distraction
Second reporter function: Captain; Pilot Not Flying
Anomaly: Deviation - Track / Heading All Types; Deviation / Discrepancy - Procedural Clearance; Deviation / Discrepancy - Procedural Published Material / Policy
Detector: Person Flight Crew
When detected: In-flight
Result: Air Traffic Control Issued New Clearance; Air Traffic Control Provided Assistance; Flight Crew Became Reoriented; Flight Crew Requested ATC Assistance / Clarification
Contributing factors: Chart Or Publication; Airspace Structure; Human Factors; Procedure
Primary problem: Chart Or Publication

Narrative: As the crew was taking Runway XXL in ZZZ for departure the Tower queried us as to whether or not we were assigned the ZZZ2 departure SID. I responded that we were cleared via the ZZZ8 Departure. This created some confusion because it sounded like we may have been given the wrong departure procedure and the question came at a very inopportune time as we were lining up with the centerline for takeoff. The controller came back and said we were cleared for takeoff on Runway XXL ZZZ8 departure. We had briefed the ZZZ8 and had elected to do this using LNAV/VNAV. The departure has you making a left turn to heading 199 upon reaching 2000 feet or DME 4.0; whichever comes first. On takeoff climbing through 2000 feet we expected to see the flight director command a right hand turn as was depicted on the PFD (Primary Flight Display) to a heading of 199. As is common with a vectored SID we could see the magenta line was continuously pushing further back until conditions had been met to initiate the turn.Climbing through 2400 feet it was clear that the Flight Director was not going to initiate a turn and that the turn was still out ahead of us for around 2 more miles. We were in day VMC conditions heading towards a mountain range and the Captain decided to revert to HDG SEL 199. As we began the turn Departure gave us a clearance to climb to 20000 feet. The environment on the flight deck was a busy one along with confusion about what the SID was commanding the Flight Director (FD) to perform and I felt it prudent to ask for the autopilot to command. While in the turn the CA (Captain) engaged the autopilot for me and it almost immediately disengaged. We reselected the autopilot to command and this time it remained on. I was calling for flaps as appropriate to the profile and then called for LNAV to go back into that mode on the SID. When the CA selected LNAV the FMC scratchpad gave us a not on intercept heading message. Most likely because we were paralleling the course after having rolled out on a 199 heading.In retrospect we probably should have just remained in HDG SEL until given further clearance. At about the same time ATC amended our clearance to 4000 feet. We were climbing through about 3400 feet at the time and quickly rolled the altitude back down to 4000 where it had been set to the previously cleared 20000 feet. Needless to say; it was a very busy takeoff and with so much going on the Captain elected to go direct to position [waypoint] to get rid of the not on intercept heading message in the scratchpad. Unfortunately that commanded a turn further past 199 HDG and the controller asked us again what departure we were on and told us to turn back to a HDG of 199. Shortly after we were cleared direct to [waypoint] and 20000 feet. We executed that on the CDU (Control Display Panel) and selected LNAV and proceeded without further incident. I feel that if I had more thoroughly briefed the departure procedure I may have stopped the Captain from selecting direct to [waypoint] amid all of the confusion. I am still not sure why the FD never initiated the right turn after meeting the conditions on the SID during the takeoff. It certainly made us wonder whether the SID was properly coded and whether or not this particular SID should just be performed in HDG mode on takeoff. Runway XXL is an unusual choice to for takeoff that is primarily occurring right now due to all of the construction taking place in ZZZ. It was a valuable lesson to make sure the SID is properly briefed and that everything we do using LNAV and following a magenta line should always be backed up with published charts and raw data in the event something like this scenario occurs.


Second narrative: In position on Runway XXL the Tower asked if we were cleared on the ZZZ2 departure. We informed them we were cleared the ZZZ8 and were cleared for takeoff. We performed the takeoff in LNAV and VNAV. The departure says climb until leaving 2000 feet or 4.0 [DME] whichever comes first; then heading 199. Through 2;400 feet the magenta line for the LNAV turn was still 2.5 miles out in front of us so we selected HDG SEL 199. After rolling out on our heading the First Officer called for LNAV to get us back on the departure. The FMC scratchpad noted not on intercept heading. During this time ATC had cleared us up to 20;000 feet and then asked us to level at 4000 feet. The First Officer asked for autopilot center command and it disconnected; so it was busy. I made the mistake of line selecting the next point at L1 and LNAV captured and turned toward [waypoint]. The controller asked us our heading and asked us to return to 199. We learned that with the magenta line in front of you we must still back up and comply with the chart requirements and LNAV might not be the best choice. We suspect not seeing the FD command a turn at 2000 or 4.0 [DME]; the ZZZ8 departure off XXL FMC Data may not be correct.


Synopsis: B747 Flight Crew reported the Flight Management System directed an incorrect departure procedure.