If that is coming from the converter, the insides of the converter are melted and loose and they are moving around internally. The converter will have to be replaced.
There was a TSB for knocking which I posted below as well.
TICKING OR KNOCKING NOISE COMING FROM THE
1997-1998 F-250 LD
Some 1997-2003 F-150 vehicles equipped with any engine, and 1997-1998 F-250 LD vehicles equipped with the 5.4L engine, may exhibit a ticking or knocking noise coming from the catalytic converters. The noise may be described as sounding like a diesel engine. The condition will be present when the vehicle is in gear at idle only, and is more pronounced when the vehicle is stationary, such as sitting in a drive-through line. The noise is normal, and is created by engine pulses being amplified through the light-off converters.
DO NOT replace converters unless loose internal components are found. To reduce the noise, install a wrap kit on each of the light-off converters. Refer to the instruction sheet included in the kit.
WARRANTY STATUS: Eligible Under Provisions Of New Vehicle Limited Warranty Coverage And Emissions Warranty Coverage
imageOpen In New TabZoom/Print
OPERATION DESCRIPTION TIME 042006A Install Wrap Kit On Both 0.7 Hr. Light-Off Converters (Includes Time To Perform Road Test)
CONDITION BASIC PART NO. CODE 5E212 42
Monday, March 8th, 2021 AT 2:46 AM