Correlation doesn’t equal causation.
The rift between SA and the US doesn’t stem from how much oil we import. In fact, the amount of oil we’ve purchased from SA has been going down since 2006 while we’ve been trying to become more oil independent and not from an increase in bans of gas cars.
Almost every European and North American country has made a claim to phase out gas cars by early to mid 21st century.
Even China has a very similar timetable to the US to phase them out so it isn’t that.
https://www.businessinsider.com/china-ban-gas-powered-cars-effect-on-oil-market-2017-9
So that isn’t why SA is buddying up with them.
SA has actually been more impressed by China’s diplomacy more than its commitment to gas powered cars.
https://www.nationalreview.com/corner/what-moved-saudi-arabia-to-embrace-china/
The article does note that China does purchase more oil than the US from SA, but it’s far more likely they’re unimpressed with our overall foreign policies. Not just from Democrats or Republicans, but from both parties.