Do not use free range pallets for anything that isn't strictly decorative with lots of coating on it. Those things are treated to high heaven with loads of chemicals and you never know what they had on them.
Woods preservatives and methyl bromide are known carcinogens and they're not even recommended to burn, let alone grow food in.
https://aaapalletco.com/are-pallets-safe-to-burn-answers-from-the-experts/