I don’t understand your logic behind it. U San Francisco will get you into a med school if you do well in it, med school don’t care which school you graduated from as long as you have a high gpa and high Mcat.
OTOH, if you did well in u San Francisco but after you transfer you did not do well in Ucb then you will not be able to get into med school.