In any game area, the nature of your practice needs to reflect your stage of improvement. The journey from maybe being a bit average at a particular skill, to learning something much better, that in turn becomes robust enough to work under pressure. Unguided, this is a challenging process because golf is hard and the human brain needs nurturing a bit by managing the learning environment.
Learning environments - at one end of the spectrum is playing a hard course, with card in hand, people watching, lots of variables like slopes, tight lies, wind etc. In this scenario the brain will most likely revert to the most dominant patterns of movement and thinking (good or bad).
At the other end, in the studio or range, we have a controlled environment with less demands, less variables and often more feedback. When we learn something new, we’d probably start here, and gradually add variables like; only having one attempt, a sense of consequence, or observers to help the new skill become match fit. The trick is to be clear what type of practice you need and tailor the session accordingly.