To be specific, Otaku never lied to Uranai about dating the other girl Shirahoshi. Though he did briefly lie about planning to confess to her, he then admitted the truth, that he had no plans to date Shirahoshi.
The key part to understand is that when he told Uranai "I'm sorry, right now, I can't go out with you" in chapter 20, what he really said is "I'm sorry, right now, I can't go out with [implicit object]." So the translator, having no knowledge of the future development which wasn't even revealed in Japanese yet, translated it as "go out with you (Uranai)". But in reality, it was "go out with Shirahoshi".
https://x.com/search?q=from:cheesesama24 インチキ占いギャル20&src=typed_query
Why did he apologize for that? The answer is: for one, he didn't know that Uranai liked him back, and for another, Uranai had put in massive amounts of efforts to try to hook him up with Shirahoshi, claiming that she was his soulmate, so he felt guilty for having rejected Shirahoshi because he still loved Uranai. The girl he loved was doing so much for him by trying to hook him up with his apparent "soulmate", but he was trampling on her goodwill by loving her instead, or so he thought.
So what he effectively said to Uranai is (brackets for what he only implied): "Actually, the person I've loved this whole time is you. [But you don't love me back, this is just my own sided love. Therefore...] I'm going to confess to Shirahoshi tomorrow. It's okay, I'm going to move on to my next love!" And then when Uranai had an extremely downcast face and became quiet, he thought she was disappointed in him for loving her instead of Shirahoshi, and so he changed his mind and admitted to her with a guilty heart that he couldn't date Shirahoshi after all, by saying, "I'm sorry, right now, I can't go out with Shirahoshi. [I was just lying to try to make you happy, since you wanted me to date Shirahoshi, but in fact, I can't get over you.]"
But of course, as I just explained, Uranai heard it differently... She believed that he had realized that she had a crush on him, and that he was rejecting her. But in fact, he still had no idea that Uranai loved him. And so, when Uranai and Otaku meet up again around chapter 49, he has been avoiding her this whole time because he believed she resented him for not dating Shirahoshi.