If you shoot a lot of copper plated .22bullets, your problem might be copper fouling, and not leading.Beretta ARX. It was fine all day...until the very end.
Try scrubbing the barrel with a good "copper-killer" cleaner.
If your problem is copper fouling, you will get a lot of green colored patches.
Keep going until your patches are clean.
You'll then need to re-season the barrel.
Copper killer tends to strip everything out of the barrel.
Good luck.