Personally, I wouldn’t add heat to my yoga practice if an injury is present. My hot yoga participation years were before I got my 200-hour yoga training, and I enjoyed the feeling of yoga in a warmer room. It definitely contributed to my ability to stretch a little farther.
That said, I was healthy with no injuries, and very regular in my yoga practice. i’d worry that someone with a pre-existing injury or a beginner would go too far into a pose without realizing it and exacerbate existing issues.