Can't remove fork from head tube!
The grey part is a wedge and has a split in it. You could use a metal pick to pry it out at the split. If you deform it in your attempt, file or sand off any burrs before you reuse it.
If you hit the top of the fork too hard it's possible to knock it out of round, even with a rubber mallet.
The problem you have encountered is quite common and can be frustrating for the mechanic when there is also corrosion on the steerer tube.