I think it potentially could be harmful, but it could also be helpful depending how you convey your realization of seeking optometry. All the power to you for getting healtcare experience as that would really supplement an optometry school application.
I had a similar experience where I wanted to do graduate school in biochemistry before I decided to quickly switch gears into optometry mode two months before their application deadlines. (is it similar? you wanting to do MD and me wanting to do at least an MS? You actually applied, and I didn't)
The only thing I'm concerned about, and what you might really want to focus on, is your motivation for optometry. And you're going to want to really support your ambition to do optometry and that you are fully informed about the profession, and then show your dedication.
I think admissions might view people in similar situations as us as potential rogues. Why invest time and a wasted seat for a person who really has passions in something else and drops out, or in a person who is clearly capable of doing optometry work (like a med school student) but doesn't really care for it and may be likely to not care and drop out (like what happened to the other undergraduates in my research lab), or for a person who goes rogue, gains sentience, and launches nukes at the world and creates a war against humanity, just like Skynet.
I was asked in all my interviews why I quickly decided to do optometry when I could have done something I really would have been happy to pursue. And I gave a well-thought, sincere response backed with support with all the optometric experience I tried to acquire in a brief amount of time, and my interviewers really appreciated my candid response. I did, however, end up losing two of my three interviews to lack of optometric experience still though, according to feedback.
If I was totally off-topic and missed the point of the MD thingy, dammit. If my post is nonsensical rambling, sorry for the crappy advice and o well just ignore it. but i think you're fine but have some explaining to do. I wouldn't omit it because it would explain some gaps why you didn't get optometric experience earlier and would explain why you did the healthcare things you did, which is totally helpful in my opinion. im hungry.