Barometer will be more accurate but it won’t be out of the box. They require calibration, and really should be set on every ride.
That’s why Garmin have a location feature where you can specify a known height for a specific location. Whenever you ride from that location it will effectively calibrate it.
However atmospheric changes, wind and such will also affect it.
I’m lazy about calibrating and I find places I haven’t set a location height will vary in height each time I ride the same place. However even when I’ve set the location on my 510, I’ve started off and gone in a loop back to the start and then it tells me I finished 100ft lower than I started.
All said, GPS altitude is by comparison poor. GPS isn’t designed for accurate altitude readings.
Then there’s another factor. Some sites you upload to, such as Strava, will auto adjust to topographical elevation if the device doesn’t have a barometer.
Ultimately I’m not fussed about the accuracy of the elevation, only the accuracy of the elevation change.