Restricting core block nested blocks

For anyone looking for something similar I came across this in a PR – https://github.com/WordPress/gutenberg/pull/31326#pullrequestreview-781388981

This filter setup has worked for any block that I’ve tried that has allowedBlocks set as an array in the block.json file.