First: fix your grinder budget before you shop
Every reviewer with an opinion on this said the same thing, and it's the least popular advice in the category. JayArr Coffee, Coffee Kev, and Lance Hedrick all agree the grinder matters more than the machine.
So the machine under $500 is not really a $500 machine. It's a $300–$400 machine plus a $100–$200 espresso grinder, which is the realistic entry point for a capable burr set. Hedrick went further: given a £300–£500 total budget, he'd spend the entire thing on a grinder and brew with an AeroPress while saving for the machine. That's an extreme position, and it tells you how lopsided the value math is.
Cheap ways in: hand grinders from Kingrinder, 1Zpresso, Timemore, Kinu, and Orphan Espresso all earn mentions. Coffee Kev points at used doserless commercial grinders from Mazzer, Ceado, Eureka, and Fiorenzato as eBay bargains, and the DF54 as a budget flat-burr option with one caveat — it can clog on very dark roasts.
Skip this step and you'll be blaming the machine for a problem that lives in the grinder.