The Washington Examiner's Byron York writes that by trashing Trump, Nikki Haley "paints herself into a corner" by turning off Republicans. As far as 2024 goes, York is absolutely correct. She'd need Trump voters and she loses more of them with every anti-Trump slur.
I argue she knows she won't be the 2024 nominee and is betting Trump will somehow contrive a way to lose to Biden. She plans to spend the next four years nagging Republicans with "I told you he'd lose but you wouldn't listen" and end up becoming the 2028 nominee.
It is a long shot but it may be the only shot she's got, so why not take it? If Trump wins she will be as unpopular as the loathed Liz Cheney.