@iternabe the pedaling sounded correct in the 2nd version.
I should also add: this and my earlier comment were about doing legato pedaling, as was indicated in the screenshot of the score you attached, and doing this as your score indicated.
However, I think a musical argument could be made for playing it without pedal and leaving a very slight separation between those chords, or for varying the pedaling of the chords between the variations. Musically, I thought the way you played it the first time sounded very reasonable, and the differences in pedaling added some interest to the variations. I quickly glanced at the original Brahms score, and in the first variation these chords are marked tenuto, so it would be appropriate to not play these chords in a full legato manner, but rather with a tiny separation between the chords.
All that said, at this stage, I think the method book wants you to do legato pedaling in those spots. You will use legato pedaling a lot, so itโs worth investing the time to feel very comfortable with it. Youโre off to a great start!