think you have to trust what is prescribed by your gynae, unless you have the proper medical knowledge that tells you otherwise. do talk to your gynae about it if you are concerned!
There are antibiotics that are safe in pregnancy. Your doctor would prescribe you those. It’s not fun to have a UTI and suffer the symptoms