It's probably a slow-twitch (endurance) vs fast-twitch (sprint) muscle thing. You're going to compensate for the climb by holding back a little more. Your HR will get up, sure, but your leg muscles won't work as fast or as hard (lower gear) to get up that climb. They'll be pushing hard, but it's different from the flat...

With the flat, you are likely to feel pretty good and get into a good cadence (90 rpm) in a harder gear and just go. You'll be working those muscles differently and probably a little faster.

Then there is the mental. Long flats can get old fast. Sustained climbs usually have interesting scenery, and the elevation change does something to the mind. It's weird. People are weird.

Also, you're working different muscle groups. I think your climbing muscles are probably your strongest, or grunt, muscles. Think glutes. A different muscle group will take over on the flat. One muscle group may be better conditioned than the other to handle sustained efforts.

So, really, it could be anything, but it could also be everything or a combination therein.