Cloudflare is an outlier because the company doesn't actually make money at present; their past three annual statements show net losses in the tens to hundreds of millions of dollars. Not hemorrhaging cash per se (their cash reserves alone could cover ~9 more years of losses), but still enough to warrant some cutbacks - and AI is the current scapegoat, thus they finger AI and throw folks out the door.
Coinbase's story is different: they're making good money, but their industry is inherently volatile. Again, recent volatility in the crypto markets related to...things...is dragging down long-term prospects for currencies, while ongoing trades are broadly just insiders doing insider things or exiting their positions for liquidity. Still, their share price is down 27% over 5 years and 18% YTD, so they also need to pump their share price so the executives get paid; layoffs are consistently rewarded by the shareholders, thus they axe part of their workforce for the bump and fingerpoint to AI.
Never take what a company says at face value, and always check their balance sheets. What Cloudflare did sucks but could be warranted to some degree; what Coinbase did has no justification whatsoever beyond naked greed.