It will work, but.............
You should be able to find lodgings as you go without to much hassle if that's the way you want to go.
Everything will "work" but what stands out to me is still the limited time you have in Yosemite compared to the time on the coast between SF and LA. You could comfortably drive down the coast in 3 days with under 5 hours driving time, yet you will have less time to enjoy Yosemite then the drive time will take. I still wouldn't bother going back to SF, instead, I would spend my time there and then go to Monterey from Yosemite, but of course it is your choice.
It looks as though you have decided to fly to SF, but I will point out [once more Lol] that a 6 hour drive from Vegas on the day you are flying would actually put you closer to Yosemite than starting out from SF.
For flights and cars, I would suggest you search the Internet for the best deals when you are travelling as they change all the time.