I think Trump is doing it for more psychological and petty reasons than a rational analysis of Machado's prospects. Trump historically is known to be incredibly petty, vindictive, and sexist. He surrounds himself with incompetents because he hates anyone with competence, since they make him look bad or take the limelight off himself. His refusal to listen to good advice means anyone competent gets frustrated and leaves (or Trump fires them). His sexism means he hates potentially competent women even more. In Trump's entire life, he has treated women as basically trophy wives, sex toys, or servants/tools, and has never tolerated them in positions of power, instead calling them "nasty" (i.e. his codeword for any woman that threatens his self-image and ego). That is why he has always been so crass and vehemently opposed to any female politician that is anything other than a spineless lackey, and especially anyone that is not white. That is why he was so crass when facing Hilary Clinton and Kamala Harris. They threatened his ego, and Kamala also offended by not being white.
Finally, anyone that has dealt with Trump before has come back saying he is petty and vindictive. He probably hates Machado for getting the Nobel Peace Prize he has coveted and therefore wants to take revenge in any fashion, such as by ostracizing and humiliating her.
Note that Trump himself may not be self-aware of these above reasons since he is a malignant narcissist and they are known to lack self-reflection even while being self-centered. He may only be self-aware to the point he realizes he dislikes Machado and therefore seeks to humiliate and destroy her, since that is what narcissists do to anyone they dislike.