A Gen1-3 Glock can be made just as mechanically accurate as mid-90's P228 or even more so.
One solution was a properly fitted aftermarket barrel. Bar-Sto went a little crazy with this adding lots of material to the barrel feet. Not needed. KKM does a really decent job in a near drop-in format.
Another solution, depending on the gun, was to have the factory barrel re-crowned.
My 2002ish "E" series G22 could not hold anything tighter than a 4" group at 25 yards. A wise old Glock sage suggested getting the factory barrel re-crowned. I did.
To my astonishment it was able to shoot 1.5" groups at 25 yards from a rest with factory Federal American Eagle 180gr ammo. Very respectable and changed my appreciation for the gun.
In a Glock, what matters most is how the barrel fits the slide (barrel hood area and the muzzle end) and that the barrel crown isn't damaged, marred, or imperfect from the factory (they frequently used to be) and that there is enough spring tension to hold it in place. The slide to frame fit can rattle and the gun will still be very mechanically accurate. There is a reason the Gen5 barrels are designed the way they are. They should have been like that thirty years ago.