Honestly I think it was a little of both. Replicants were essentially just bio-engineered humans. Techinically artificial, but still capable of the full human experience, including emotions.
Joi seemed to be more a mass produced "fake girlfriend", and from the looks of it a highly commercialized user friendly program that K had kept on the default settings. Programmed to act like the perfect woman but not capable of actual affection. However regardless of what she actually was, it didn't stop Ryan Gosling from becoming attached to her and thinking of her as a real person. K struck me as a very lonely man, and given Joi's appearance and programming I can see how that line started to blur for him.
But when he saw the hologram on the bridge; saw the intimacy he thought he shared with Joi advertised for public consumption, I think it really hit him that not only was she gone, but that the memories he made with her were meaningless. Just another artificial product for sale in a hyper commercialized society. It hit him that he was gullible for thinking he found a genuine connection with something that couldn't love him back. Even his grief he had been feeling over loss was more pathetic than meaningful. He fell hard for the corporate lie that he believed himself to be better than. And because of his status as a replicant, it further made him see his own entire existence as meaningless. That was when he hit bottom.
Not to get too personal, but it reminds me of a time about a year back when I broke up with my girlfriend who I was absolutely crazy about. That in and of itself majorly sucked, but whats worse is she told me during the breakup that she had known for awhile that she wanted to do this. A week later when I was putting away all the stuff that reminded me of her I came across a picture of the two of us that I took about a month prior. I took it because I thought it had been a really great day and I wanted to remember how happy I was in that moment. But now with the revelation that even then when that photo was taken she had been intending to break up with me, it suddenly made everything a thousand times worse. Not only were those times gone, but even the happy memories I cherished never really existed. Id imagine K felt the same way at the sight of an advertisement for the Joi program.