The farrier could have just trimmed it to short and has made it more sensitive for the horse so his hoof needs to grow out a little to become none sensitive
Trimming might well have been done poorly or too aggresively. Soreness resulting after or from trimming is, unfortunately, not uncommon. If you have an Easy Boot on hand or another brand of hoof boot, I’d suggest putting it on for a bit. Otherwise I’d have a vet look at it. Vet woukd likely prescribe an antinflammatory/painkiller. Good trimming should NOT result in soreness or lameness.
Well since you mentioned his hoof being trimmed the day before he could just be sore if that is the case just walk him on softer ground he should work out of it.