I’m a transfer, and I had a lot of success going this route rather than taking a gap year! While some schools are much more selective because they don’t have transfer programs (Harvard had 12 spots for over 2,000 transfer applicants this cycle), some have designated seats for transfers. I was admitted to Columbia, UChicago, Dartmouth, Northwestern, and Cornell this cycle, for example.
If you’re set on HYPSM, a gap year would probably be more strategic, but transferring is not unwise for other top schools.