pUC19 does not contain an entire lacZ gene, but a sequence coding for a short, non-functional N-terminal segment denominated the alpha fragment. When expressed in a host expressing the remainder of the lacZ gene (an also non-functional segment denominated the omega fragment) both fragments associate in vivo to produce functional beta-galactosidase, a phenomenon known as alpha complementation.
If you wish to produce full-length lacZ in pUC19 you will have to amplify the missing lacZ fragment and clone it in-frame with the alfa fragment present in the vector.