I had the same prob recently with a 2nd hand Omark .223 with a Madco barrel. Apparently the previous owner never ran in the barrel.
The first time I shot the rifle I was getting 1 inch groups at 200m with an origional Omark stock with factory Remmington ammo.
I got a Ken Noyle custom stock which was professionally bedded to my action and started shooting 3-4 inch groups at 50m.
It was so badly fouled it took 7 cleans with ferocious scrubbing with nylon brushes and once I ran it in properly it went back to small groups after about 250 rounds.
I shot about 5 rounds at a time then let the rifle cool down - not that it was getting really hot.
Rough barrel basically. Usually new barrels don't take that long to settle down.
Some .22's--Lots of 303 Lithgows--Tactical Mosin--7mm and an 8mm--Underover--Farmers Shottie--Angel and Omark