A climb gradient requirement is not the same as an altitude restriction at a certain point. When the chart says that a 7 % climb gradient is required up to 7000, that means that you should stay above this slope all the time! Theoretically it could be that you make the restriction at 7000 ft with more then a 7 % average climb rate, BUT you might have gone below the required slope during the acceleration phase to get your flaps up.
So, as I said in
my previous post: "In case of doubt when in IMC or by night, you can consider delaying the acceleration and flap retraction until out of the restricting altitude"