I have never heard this expression but this is what I found about its origins on the Wiki:
The origin for this use of the term is in dispute. The OED cites its origin as within the Royal Air Force; as of 2003 the earliest citation there is a quote in the 1983 book Air War South Atlantic.[1] Others date it to the RAF in the 1940s, from pilots attempting to perform aerial manoeuvres such as loops. These are difficult to form perfectly, and are usually noticeably distorted—i.e., pear-shaped.
Other theories include:
* If the original plan was to be visualised as a perfect circle, then the failed execution might be pictured as a distorted figure, hence "pear-shaped".
* In pottery, when a bowl, or whatever is being turned, ends up rather less circular than one would like.
* Round party balloons suggest celebration and success, but as they deflate they take on a pear shape.
* Some aircraft engines become distorted (pear-shaped) in the event of failure.
* Early biplane aircraft buckled into a pear-shape when they crashed, especially stalling on take-off.
* The phrase refers to the shape of a gas balloon when it loses pressure. Gas balloons are spherical due to aerostatic pressure, but when they leak the gas rises to the top of the balloon and the neck bunches up, causing the balloon to look like an upside-down pear. The phrase hails from Victorian England when gas balloons first became popular.
* In glass blowing it describes a failed circular blown vessel. If over heated the glass becomes too fluid and distorts under gravity as it cools, resulting in a pear-shaped vessel. This was particularly important with early experiments with cathode ray tubes, where creating a large spherical glass vessel was necessary. Blowing such an object was a challenge and often 'went pear shaped'.
* It may be a mechanical engineering term: White metal bearings (large stationary engines and the like) when worn become "pear shaped" sometimes, due to wear and tear. It was also used to indicate poor workmanship in the manufacturing.