They're both pretty bad deals IMO.
Hosmer I just never liked. He always has a GB% over 50% and completely relies on BABIP luck to have his good seasons. His OPS+/wRC+ were below league average in year 1 of the deal.
Roughly 1/3 of Machado's value has come from defense since he began his career. Defense is the first thing to typically go. San Diego will be lucky if he's providing positive defensive value 5 years from now, let alone 10. He's only had an OPS over .850 3 out of his 7 seasons, and that's in the most offensive friendly division in baseball. He's now moving to the least offensive division in baseball. He's a great player, but I'm not sure how he'll be at age 31 relative to bigger offensive talents.
I think the last 4 years of this deal will be close to a sunk cost for the Padres. $30M may not be as daunting of a number in 2025, but still, I don't like the risk here for them. They better pray that Tatis is a monster and that Urias, Patino, Morejon, and Paddack are good too. They need to be a contender a few years from now for these huge deals to make any sense.