Sorry to hear about the problem you've encountered. I've never heard of that issue before. Do you have links to the websites and posts that suggest this is a known issue? The reason I ask is that we have many, many happy K-50 owners here on the forums. Also, who specifically did you send the camera to for repairs? Was it a Pentax authorised service centre (in which case, which one?), or Adorama? It would help other members here to know. We have an active Adorama representative here - @Helen Oster; - who may be able to help you.
It's unlikely any supplier would upgrade you to a different camera (regardless of manufacturer) unless they were unable to satisfactorily repair the one you had bought, especially after 1.5 years of use. Were they able to repair it, and did that repair come with any kind of warranty?
I'm also sorry to hear you wouldn't buy another Pentax camera in future. Like any manufacturer, they occasionally have problems (there are various models from all the major manufacturers that have had frequent problems - Nikon, Canon, Sony etc.) - it's just a fact of life. I think you've been very unlucky with your particular K-50. That said, let us know how we can help you... We're a Pentax-enthusiast website, so you'll be in good company if you decide to continue shooting with a Pentax camera now or in the future