And i dont know which ISO you were on. Probably auto ISO.
I can only speak of my experience of photographing church wedding and Uni convocation using film SLRs in my days.
Firstly, having a good flashgun is very important. For church weddings, flash with guide number (GN) of 28 and above is ideal. Set up your flash for your zoom range is also important. Some TTL flash will auto zoom with the zoom you adjusted.... but some you will need to adjust the zoom yourself. What i do is set the zoom to widest possible (24mm or 35mm depending on your flashgun), the use exposure compensation to push up the exposure if i zoom to tele range. Depending on flashguns, usually setting it at 35mm ... shooting at 50mm is not a problem at all. But if you zoom to 105mm with 35mm setting, it may underexpose. Then either you adjust the flash, or use exposure compensation.
Secondly, church ceiling is usually very high, bouncing off the ceiling is almost not possible. Your shots will be under exposed. Using flash bounce diffuser should be the only option. Shoot with flash gun head on... you will get ugly shadows.
Thirdly, i dont know how DSLR works with Auto ISO and flash, but for quality shots i'd lock the ISO at 400 or max 800 with flash. So i have more control over the aperture and shutter speed. Otherwise, Auto ISO might set it to lowest 100 or 200, which is not ideal for flash photography. In my film days, i have no choice but to stick to whatever ISO film i got. Usually ISO400.
Fourthly, Knowing you camera X-sync speed. ... most camera topped at 1/250. I believe only Olympus cameras has X-sync of up to max shutter speed of the camera (e.g. 1/4000 or 1/8000). If you use P mode, likely the camera will set x-sync speed to maximum, ie. 1/250 or 1/125 (depending on camera model). You should dial it down to 1/60 so that wider aperture range can be used.
Hopefully by sharing my previous experience helps you take good pictures, even on P mode for weddings. In any case, if you are unsure, always bracket your shots. 3 frame bracket with 1 stop interval is good enough. At least you will have majority of your shots in acceptable exposure range.