Hi Trm and welcome! I’m not a expert, but to me it sounds like it could be a tracking problem. My suggestion would be to book in with a physio and have it checked out now, before it gets worse and snowballs into a more complicated problem (e.g. before maltracking or whatever else is going on there upsets cartilage, ligaments, etc.) I’m not sure giving up squatting is necessarily a long term solution, as you risk getting into a vicious circle where your muscles get weaker BUT the maltracking is still there and not addressed. I was advised along those lines by a physio a few years back when I complained about pain lunging - address the issue by balancing the muscles, don’t run away from it by just giving up lunging. Now that I’ve had ACL surgery obviously a whole host of muscles in the leg are firing all wrong and I’m getting occasional discomfort squatting, leg pressing etc. The physio is keeping those exercises in my programme but adding others to recruit and balance the muscles and he is monitoring and correcting my form with squats etc.
Very best of luck and hope you can sort this quickly and smoothly!