What the F*** is going on!

Took four home pregnancy test 2 are positive 2 are negative went to the DR today they gave me a urine screening and came back and said yes I’m pregnant and that I also have a UTI. Came home took another test and it says not pregnant! Could the UTI be giving me false positives?