I make it a standard policy to always install the barrel, then the lock. Conversely, when disassembling, remove the lock first. In many rifles, the lock screw goes through the bolster on the breechplug. Also, I have had barrel/lock combinations where the lock screw (or front screw if the lock has two screws) hit the bottom of the barrel and required a shallow groove in the barrel to allow proper fit. Obviously, don't make this groove too deep for safety's sake. How deep depends on the barrel.
One other possibility, as you thought, sometimes the mainspring does interfere with the barrel. Someone with more knowledge needs to tell you how to get around this. I have fixed this situation before, but am not qualified to advise someone else.