You have an upscale espresso machine with a standard, non-pressurized portafilter. So as you know there normally isn't any pressure in the portafilter when you go to remove it after a shot.
Backflushing can only be done on machines like yours that have a 3-way valve. And it's basically just putting a blind (sealed) basket or rubber disc into the portafilter and pulling three short shot cycles. That is put the portafilter, with a blind basket into the group then let the pump run for about 8 seconds, then stop the pump for a few seconds. Then repeat two more times before removing the portafilter.
This flushes out the brew path. Backflushing with water is safe but you shouldn't do a frequent chemical backflush on an E61 type machine. Most of the time this can be resolved by doing a backflush (sometimes you may need to do two or three backflushes) which will clean the brew path. When was the last time you did a backflush on the machine? You should be backflushing with plain water weekly. And with a food safe detergent every 200 shots.
When the portafilter does remain under pressure it means that the "3 way over-pressure valve" that normally relieves the group pressure is sticking. Or more precisely something in the expansion chamber is sticking or the internal E61 cam isn't moving completely smoothly.
The easiest way to check for scale (mineral) buildup on an E61 machine like yours is to remove the gicleur chamber nut and mushroom at the top of the E61 assembly and visually inspect the removed parts and the group head internals which will now be visible.