Bathrooms can be very unfriendly to radio signals. You have mirrors that block or reflect signals. You have electric wiring, water piping, HVAC and exhaust vent ducts in the walls, floor, and ceiling. In my master bath, I had a tough time maintaining Z-wave connections, so I replaced my Z-wave motion sensors with Zigbee. My lights are controlled by Lutron Caseta Clear Connect which has been reliable. Also Zigbee motion sensors tend to trigger faster than Z-wave; at least that is my experience.
I use a basic rule to trigger my bathroom lights. If the motion sensor triggers, it turns the lights on to 50%. If I need more light, I can adjust the dimmer manually. That would occur only when I am shaving or my wife is putting on makeup or trimming her eyebrows. The lights will turn off after no motion is detected for five minutes, although that could be adjusted. I have the rule restricted so it only functions during normal waking hours. I do not want the lights coming on at 3:00 am if I have to use the toilet, a night light is sufficient for that.
My motion sensor is aimed at the bathroom door. By the time I enter the bathroom, the motion sensor has detected my movement and turned the lights on.
Also, if you tend to keep the bathroom door closed, you can use a contact sensor on the door as a trigger as well. If the contact sensor opens, the lights will come on. I do that with the door between the house and the laundry room. Although there is a motion sensor in the garage, it is slow to detect movement coming from the house into the garage. The contact sensor resolved that problem. Now the lights are on before I set foot in the garage.