The only think you need the rifle for before the castle is at the first merchant, and then again you only need it for that one area. Once you're done with it or are out of ammo you can sell it back and don't need it until the castle. I don't know about you, but for me the rifle isn't a weapon I use too much. The handgun (in particular the Red9) is my favorite. Useful, handy in about any situation, and there's plenty of ammo assuming you know how to conserve ammo.
But yeah, the rifle isn't really a reliable weapon, but if you like it you can get real good with it, same goes with any weapon.