It may help to assign a new collision category when the pointerdown function is called. Something like:
cat1= this.matter.world.nextCategory();
cat2= this.matter.world.nextCategory();
platform = this.matter.add.rectangle(100, 46, 40, 10, {
isStatic: true,
});
ball = this.matter.add.circle(100, 8, 6, {
isStatic: true
});
platform.setCollisionCategory(cat1);
ball.setCollisionCategory(cat2);
ball.setCollidesWith(cat2);
this.input.on("pointerdown", function() {
ball.setStatic(false);
platform.setCollisionCategory(cat2);
});