Could have been a coaching issue or mechanical issue. My son is only 9 but loves baseball and I somehow managed to instill some bad habits in his throwing technique early on so he struggles with consistency at this point. He can throw hard and accurately, but when he forgets to focus on the mechanics we're working on fixing, he loses all accuracy.
Consistency and mechanics are key for sustained accuracy, and while I don't know your background, if you never had a coach help you with your form, it's not surprising that you struggle with accuracy.