This error is due to invalid webfilter category that should not exist in FortiOS 5.x
Look in the FortiGate config for something like:
conf webfilter profile
set category 32
set action warning
So whenever you find "set category 32" under webfilter profile, you should delete it.
config webfilter profile edit profile_name config ftgd-wf config filters show
After "show" command you will see some output. Search for "set category 32" - it does not have to be under "edit 32" - it may have another number. You should delete it and then retrieve the config. No need to remove from FortiManager - retrieve button in "revision history" will do the thing.