It looks very plausible that stretching before you exercise doesn’t do much for you. Multiple older surveys suggested this.
Annoyingly, the studies linked in the previous paragraph are 2 decades old, and somehow I can’t find a large, well controlled, trial.
static stretching is for cool down & recovery, with the goal of increasing mobility when you’re already warm and loosened up.
dynamic warmups, especially in your specific problem areas (knees/shoulders), will help prevent pain and injuries.
source: 20 years of lifting and rugby with enough injuries for a minor in PT. I’ve learned my lesson(s).