Most people would think that using machines is safer but it’s not.
If you lift a dumbbell over your head, every muscle around that shoulder joint needs to work together. Small muscles stabilize while others do the big work of lifting.
If you press a machine overhead the machine does the stabilizing for you. Not allowing the small muscles to work. This creates a weak link in the shoulder because the small stabilizers are not getting worked.
If you work with machines too often you end up with a shoulder imbalance of strong muscles and weak ones.
Now, you’re at home and you need to lift a box into the top shelf of your garage and BAM! You feel a little pain in the front of your shoulder. Now you can’t lift for weeks.
So, free weights wins for this reason. Assuming you’re lifting with proper form, progression and rest time between workouts.
But don’t get me wrong: I’m not against machines.
Machines are good at targeting certain areas when it comes to building muscle. They allow you to manipulate the “strength curve” of a movement. Meaning, the resistance gets harder in areas that may otherwise be easy with free weights. This is great if you want to target a certain body part. Chains and rubber bands can also change the strength curve. I love those, too. Since variation is a strong component of localized hypertrophy, you should mix it up.
To avoid injury, I suggest you keep heavy movements for free weights.
Use machines for lighter intensity (weight), higher volume (sets x reps x weight) exercises. Work to strengthen, small stabilizer muscles and always lift with proper form.