He was a fodder for an admiral though.
Like always it's within the context of the movie
Just look at his story (i checked the wiki lol)
Z was an admiral at 38
Then 3y later his family was killed and he resigned from admiral position
He then spent 23y just traning young ones as instructor
Then his arm got cut by a pirate and whole squad decimated
Then at 70 he got a mechanical arm
And the man was sick and had breathing problems
By the time Luffy fought him at age 74 he wasn't in his prime at all. The man wasn't in active duty since his 41y.
And Z level was fluctating through the whole movie : could fight Kizaru a little bit in the beginning, then destroyed Luffy, and only in the end Luffy managed to "beat" him. And even after than Z managed to fight thousands marines and tank Kizaru laser spam while staying consicous.
Luffy vs Z was classic Luffy beating someone above his pay grade due to plot/circumstances/nerf etc