Man spent 5 months in jail before conviction quashed over concerns he was 'coerced' into plea