Two most likely scenarios are a plugged/kinked drain tube
OR a disconnected drain tube.......
Easy to check
Jack up the rear of the car....open sunroof......with water bottle and funnel.....add water slowly to rf corner of sunroof water tray.......water should not build up...if it does, then tube kinked/plugged....if it drops, should come out immediately out of the bottom of the "A" pillar....if it doesn't, and comes out of headliner or switch, then tube on that side is disconnected.....then try opposite side......then jack the front up and do the same test to the rear corners....