It is possible to make such a curve for which a particular ray of light will keep bouncing back and forth within a confined region even if the curve is not closed.
One specific case is a hyperbola, but I'm sure there are other examples.
The hyperbola has a reflective property, like the other conic sections. If a ray of light is aimed at one focus, the reflection of that ray will be heading towards the other focus. This will then be reflected back and forth indefinitely.
![enter image description here](
All you need to make a concrete example are the two segments of the hyperbola around the x-axis, and then fill in the rest with anything that does not block the rays.
And, yes, I stole the illustration from the reference I gave as I'm no good at making them. If my answer is not clear enough, I can try making a better drawing.