Are medical professionals the only people who can translate or write medical texts well?

No!
A medical professional, such as a physician or a nurse, may not be automatically qualified to translate or write medical texts. Being a professional in a specific field doesn't necessarily confer good communication skills. Among the many things needed to communicate well, one must be sensitive enough to linguistic and cultural issues overall.
According to Marla O'Neill:
"Good medical translation can be done by both medical professionals and medically knowledgeable linguists; but in both cases [...], a love for language, an ear for style, a willingness to pursue arcane terminology, and caring enough to get it exactly right are the keys to true success (1998: 80)."
Therefore, linguists with appropriate medical knowledge can also perform well as medical translators or as medical writers.
Some medical professionals, however, disagree. While medical specialists are likely a better fit for specific technical translation/writing projects, medically knowledgeable linguists don't have to go to medical school to do their work well. A combination of continuing education (e.g., self-study and specialized courses) and practice will generally suffice.
For instance, Vicent Montalt and María González-Davies state that:
"To understand and explain a cataract operation, you don't need to be an ophthalmologist. Comprehending the cataract operation is necessary but not enough to perform it (2014: 35)."
As a linguist, I must always understand what I'm working with. Yet, I don't need to have the skill to perform what I'm translating or writing about. Medical writers and medical translators have to know how to access the appropriate documentation and learn continually about their specialization to succeed.
If trained appropriately, both medical professionals and medically knowledgeable linguists can write or translate medical texts. In some instances, one group will be better prepared than the other.
Would you like to learn more about my journey of specialization as a medical communicator?
Feel free to contact me if you have any questions!