It is strictly impossible for an airline to know for sure and in advance if you will be allowed into a country or even allowed to board.
While the general cases can be relatively easy, there are so many special cases and exceptions it’s not even funny, there’s a lot of information they don’t even have (like previous travel history), and authorities have discretionary power to reject anyone at the border, or for countries with bidirectional API (like the US), at time of boarding (the dreaded “DO NOT BOARD”).
Even without getting to that point, tools like Timatic have a few limited cases where they will say “no visa required” or “visa required”, and then tons of cases where they have long lists of conditions and exceptions and special cases which are not standardised enough that you can just enter data and get a verdict, you just get something a human must interpret (which is often not quite obvious), sometimes pages and pages long, and is sometimes subject to errors.
Add to that the fact that things change quite often, and you get a big mess, which airlines absolutely do not want to enter, as it could open them to a whole lot of liability. So they just stay clear and put the responsibility squarely on the shoulders of the passenger, and they honestly very little other choice.
Many airlines and OTAs will make it quite obvious and explicit at the time of purchase, but it is always spelled out in the terms and conditions.