All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad ﷺ is His slave and Messenger.
Coughing in the direction of the Qiblah is not prohibited; rather, what is prohibited is expectorating toward the Qiblah. Accordingly, we advise that you refrain from turning your head while coughing, as this constitutes an unnecessary movement, and turning away during the prayer is deemed disliked (makrūh), as explicitly stated by the jurists.
Allah knows best.