from wikipedia
A failed bank robbery, for example, could be said to have "gone pear-shaped". 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 (ISBN 0-283-99035-X). 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. The phrase first came to the popular media when being commonly used in the British drama series The Bill.