Well, they tried, they just couldn’t.
The first the Gorosei are aware of him is after Alabasta. Luffy gies shooting up to Skypiea after that.
Then Aokiji goes hunting him down. He says that’s he’s always paid attention to Luffy (probably because he’s Garp’s grandson) and he’s frightened of his potential. He could have captured Luffy if he wanted, but didn’t.
Then they strike the deal with Robin that she comes in exchange for the Strawhats freedom. Would they have been better just capturing them both, yes. Here’s where it’s important that Luffy is not the only person who has eaten the Gomu Gomu since Joy Boy. If there has been eight hundred years worth of ‘failed’ GG eaters, then it makes sense he’s not a huge priority and they chose to focus on Robin instead.
If there hasn’t been, horrible mistake.
EL finishes, again, Garp and Kuzan don’t do their jobs. Luffy escapes to Thriller Bark, Kuma, again, does not do his job.
Saobody, Kizaru does do his job, but Ray and Kuma get in the way.
ID and Marineford, they try to kill Luffy, doesn’t work. Vanishes for two years. Resurfaces again, in PH Smoker tries to hunt Luffy down but works with him instead. Also couldn’t actually capture Luffy if he wanted to.
Appears on Dressrosa, if Fujitora does his job he’s captured. Instead he… does not.
Then Zou and WCI, out of WG aim, and Wano, where the legendary Mr Go finally has the chance to intervene.
So this is not one of the areas where I’m overly bothered with the reveal. Luffy’s escaped mostly because of Admirals not being mindless slaves to the World Gov (do they even know about Nika) and powerful people protecting him when he was weaker. The only wrinkle is W7 where they chose to focus on Robin instead of him, that can only be explained by them
-not knowing Luffy had the fruit (possible, but makes them incompetent)
-knowing, but not caring because many others have eaten it over the years.
Oda really needs to go for the second option.