I'm guessing the idea is to teach mostly straight cisgender students about everyday LGBT experiences, going beyond an academic "we learned about this in class" understanding to an "I experienced genuine fear from simply walking down the street" understanding. Basically, it's to develop empathy.
... this trivializes queer students and also creates unsafe situations for them.
The idea is probably to make the students feel unsafe: all the students. And afterwards pose the question "if this level of safety is unacceptable for you (even for just a day), why is it acceptable for LGBT people?"
I get that it trivializes queer students by boiling their identities down to superficial acts. It's also a bit weird that there's an implicit assumption that there are no LGBT students in the class. But no assignment is perfect.
Is it ethical?
It's kind of edgy.
There would be valid religious objections to this assignment. However, I find it hard to believe that a professor of religion is unprepared for this possibility.
It is possible a student could get attacked or arrested while conducting this assignment. At the same time, this is the point: this "safety risk" is "everyday life" for LGBT people.
However, there's ways to "play it safe" by conducting the assignment from home (and it wouldn't be too dissimilar from the LGBT people who experience anxiety at a level where they are afraid to leave the house). E.g. present yourself as an "identified" gender, and post an anonymized picture of yourself to a transgender website and see what they say (I used to do this when I was closeted, so it's an official Transgender Experience™).