Machines can be safer but one of the benefits of free weights is it forces the balance aspect which means different muscle groups working together. Once you eliminate the problem of balance you move from a 3D exercise to a 1D exercise. Two of those dimensions may be near zero, but that's the point;
you need to keep them near zero.
When I started doing bench presses again after having used various machines for years, the bar started wobbling -- left/right, toward my legs/head. Machines won't let the bar do that so it's a one dimensional exercise, strictly up/down. Safe, but you lose the finer muscle engagement. There's probably a happy middle and that would be to use both. Use the machine for power with safety and then use free-weights to train those "other" muscles.
I sorta do this, using a machine for leg presses and then free weights for squats. I do lots of weight on the machine, worst case I get stuck at the bottom and am forced to crawl out of the machine when it hits the hard stops. Then I'd start removing plates hoping nobody saw my faux pa
fortunately this hasn't happened to me (yet), but I saw it happen a few years ago. Rather than the lifter crawling out we started pulling plates until he could press the remaining weight. No harm done.
Regardless, there is a trade-off when going to a machine.