Wordpress gets you into trouble all the time imo. There are better solutions out there. Every headless cms I’ve used has been much less of a headache compared to Wordpress. I wish I could share your optimism on it, but man, it’s a real pain.
Perhaps what keeps it so dominate in the space is its plugin ecosystem. You can pretty much do anything with it with off the shelf plugins, and a metric fuckton of duct tape. Headless options are way better, but you need to implement stuff yourself. Which of course is a massive barrier in many cases, but when you have the ability to do so, it’s almost always better to do so.