Sorry you're struggling. Working on your swing and playing "golf" on the course are two different things. "Routine" is the key for the course. It does not necessarily mean you'll play great or even better (depends on many factors), but it is your only chance for consistency.
You can't be learning something on the course. You learn it at the range, then hopefully take it to the course. If you can consistently do something well at the range, then it does not hold up on the course... you're problem is "routine". If your routine is solid, repeatable, the same... you mind and body will be comfortable no matter where you are. You have to be familiar with it. When you play your mind has to be quiet and focused on one or two thoughts that you trust. If you can't find anything that is working, you should not be on the course. Oh don't forget, golf is very hard... for all of us. No one ever "gets it" and keeps it. It is an ongoing process.
Move Less ... Get Good! DUPLESSISGOLF