Using /fill replace you can replace a block with another, but you can also replace a set of blocks with another, ex. /fill ~-5 ~-5 ~-5 ~5 ~5 ~5 stone replace #minecraft:impermeable works to replace glass with stone. However, this fails on player created tags in datapacks, although the command will run successfully it won't actually fill any blocks.
Please include the data pack and command used