There doesn't seem to be any contradiction with what we see Doctor Strange do and the quote by The Ancient One. This is the conversation in Doctor Strange:
The Ancient One: I've spent so many years peering through time, looking at this exact moment. But I can't see past it. I've prevented countless terrible futures and after each one there's always another, and they all lead here but never further.
Strange: You think this is where you die.
The Ancient One: You wonder what I see in your future?
Strange: No. Yes.
The Ancient One: I never saw your future, only its possibilities. You have such a capacity for goodness. You've always excelled, but not because you crave success but because of your fear of failure.
The Ancient One is looking into her future and can't see past the point where she dies for her own future. However, she can see past the point in Doctor Strange's future and see his possible futures. This is in line with what we see him do in Avengers: Infinity War in that he looks into the possible futures for the whole team and how they win not necessarily his own future.
Doctor Strange: [panting] I went forward in time to view alternate futures. To see all the possible outcomes of the coming conflict.
Peter Quill: How many did you see?
Doctor Strange: 14,000,605.
Tony Stark: How many did we win?
[Strange stares intently at Tony for a moment]
Strange: [pause] One.
Avengers: Infinity War
It's also worth noting that Strange uses the Time Stone to see into the future whereas it appears that The Ancient One doesn't use it and so this likely plays a part in it too.