I have no idea how this happens but does anyone know how prevent it or fix it
Use /repair to remove the blocks.
As Wumbo said, but not just the block, it will fix the space so that blocks can be placed without breaking.
Unless it’s a natural block
god… this reminds me of the old woven flax mats besides the fact embers don’t work