Indeed, I used to drink coffee until rather late and sleep well. 20 years ago, I started ti limit myself to 3 cups per day, and now drinking coffee at night keeps me awake (I think; never bothered to experiment thoroughly to find out). Age may have an influence, as might habituation.
Age is definitely a factor. In my 20s I could drink liters of coffee any time without problems. Now even one cup is having significant impact on me. I have heard the same from other people.