Narrative:

After takeoff, we attempted to retract the gear but the mains stayed down and locked. We check all the related system and found no apparent problems so returned to the airport. On arrival at the gate, we found the main gear pins installed. We learned later that the aircraft had been ferried from gsp to ZZZ with the gear down and the pins installed and flags removed. When I did my preflight of the cockpit I noted that all 4 flags were behind the first officer seat per the standards manual but it never came to mind that the mechanics had removed the flags from the pins.

Google
 

Original NASA ASRS Text

Title: A COMMERCIAL FIXED WING MDT IMMEDIATELY AFTER TKOF DIVERTED DUE TO INABILITY TO RETRACT THE MAIN LNDG GEAR CAUSED BY MAIN GEAR PINS NOT REMOVED AFTER MAINT.

Narrative: AFTER TKOF, WE ATTEMPTED TO RETRACT THE GEAR BUT THE MAINS STAYED DOWN AND LOCKED. WE CHK ALL THE RELATED SYS AND FOUND NO APPARENT PROBS SO RETURNED TO THE ARPT. ON ARR AT THE GATE, WE FOUND THE MAIN GEAR PINS INSTALLED. WE LEARNED LATER THAT THE ACFT HAD BEEN FERRIED FROM GSP TO ZZZ WITH THE GEAR DOWN AND THE PINS INSTALLED AND FLAGS REMOVED. WHEN I DID MY PREFLT OF THE COCKPIT I NOTED THAT ALL 4 FLAGS WERE BEHIND THE FO SEAT PER THE STANDARDS MANUAL BUT IT NEVER CAME TO MIND THAT THE MECHS HAD REMOVED THE FLAGS FROM THE PINS.

Data retrieved from NASA's ASRS site as of July 2007 and automatically converted to unabbreviated mixed upper/lowercase text. This report is for informational purposes with no guarantee of accuracy. See NASA's ASRS site for official report.