Very similar thing happened to me many decades ago. The boss took me out to dinner, didn't fire me, but had a off the record discussion to tell me I was an a**hole and a jerk to deal with. And no matter how good I was at my job, I wasn't worth the effort to him or others. He gave some examples and it was hard to listen to, but I knew he was right. It was a change moment for me as I mistook being the best for being ruthless, and frankly, being like that took a lot of energy for me as it really wasn't my nature. Made changes, made friends and grew considerably. We still keep in contact and are friends. He did me a big favor.