I lost confidence in my old Remington 7400 in 30-06 years ago. There's a great thread on the guns you wish you never owned. I was a young shooter but learned some lessons on diagnosing the gun and myself as the shooter. I've used these lessons a lot as a long range rifle instructor/coach and military marksmanship instructor.
1. Starting over. Take a load that you're confident in if a reloader or quality factory load and stick with the same load throughout testing/training.
2. Get comfortable. Find a place to go prone and spend the time you need to be comfortable shooting.
3. Give large reactive targets. Begin at close distances. (50 yard max) This is not about precision, it's about seeing a hit.
4. Keep the sessions short. This goes for all sessions. Get several good hits in a row then walk away. Take a smoke break or whatever it is for you, but come off the gun. Maybe, maybe get a few more hits in then pack it up for the day.
5. Extending the range. Take the large reactive targets out further as long as you're getting consistent hits. 100, then 125, then 150.
6. Close for precision. Bring a standard target back in to 50 yards and work on precision drills. I like card games. I'll take a piece of cardboard and glue some playing cards on it. Then work on individual shapes (hearts, diamonds, clubs, spades) on a particular card.
7. Get a friend. Have someone watch your fundamentals and form or video yourself. Make a checklist if you need it that you can reference while prone. Body position, grip, sight picture, sight alignment, trigger control, breathing, follow-through.
8. Dry fire, dry fire, dry fire.
9. Shoot long. Go straight to longer than normal shots for precision, and be happy with decent results but if you took the time with fundamentals most shooters are surprised at how well they grouped.
10. Mid range precision. Immediately move to a midrange (whatever that is for you, hunting range or competition range) and work on precision. Don't worry about the occasional flyer, just get a high volume of quality hits.
11. Keep it fun. If you're not enjoying it at any time, pack up and go home. If you need a couple months off from shooting to forget the stress, then do it. Shoot some pistol or an AR to have fun shooting again.
If it's the gun and not the shooter, it will normally show itself in #6. If questionable, repeat steps 6 & 7 multiple times then have someone else shoot the gun. In the end you need to be happy with it so send it down the road if all else fails.