An aircraft maintenance worker at Miami’s airport allegedly tampered with a critical piece of a passenger plane’s hardware in July to get overtime pay amid a stalled union contract dispute, according to court documents.

The American Airlines plane with 150 people on board never left for the scheduled July 17 flight from Miami to Nassau in the Bahamas after flight crew noticed an error related to the "air data module" and called it off, the documents say.

Abdul-Majeed Marouf Ahmed Alani, who worked in aircraft maintenance at the American Airlines hangar at Miami International Airport, is charged with willfully damaging, destroying, disabling or wrecking an aircraft, and attempting to do so, according to court documents.

Alani was interviewed by law enforcement Thursday and said he never intended to cause harm to the aircraft or the passengers, but he had been hurting financially from a stalled contract dispute between the union and the airline, according to an affidavit from a federal air marshal filed in the case.

An American Airlines plane takes off from the Miami International Airport in Miami, Florida on Nov 12, 2013. Joe Raedle / Getty Images file

He allegedly used super glue to attach a piece of foam into an inlet on the air data module, which reports information like an aircraft’s speed, pitch and other data, according to the document.

Alani "claimed that he tampered with the Target Aircraft in order to cause a delay or have the flight cancelled in anticipation of obtaining overtime work," the affidavit says.

American Airlines said Flight 2834 returned to the gate for maintenance, and all the passengers were put on another plane bound for Nassau.

"American immediately notified federal law enforcement who took over the investigation with our full cooperation," the airline said in a statement.

It was unclear from online court records Thursday night whether Alani had an attorney who could comment on his behalf. A phone number for anyone connected with Alani could not immediately be found.

After the aircraft was taken to maintenance, workers found that the air data module “appeared to have been deliberately obstructed with what appeared to be a dark Styrofoam-type material,” the affidavit says.

Investigators used surveillance video and interviews with other workers to identify Alani, with one naming him based on his “unique walk,” according to the affidavit.

The footage allegedly showed Alani enter the plane’s forward electronics and equipment compartment and spend about seven minutes there the morning of the incident.

The Miami Herald reported that the labor dispute involves a 12,000-employee mechanics' union and American Airlines.