I worked for the phone company for 30 years, 3 years as a directory assistance operator. Non-published phone numbers and unlisted phone numbers aren't the same. Unlisted phone numbers were not in the phone book, but could be obtained through directory assistance. Non-published numbers weren't in the phone book or in directory assistance. I couldn't see non-published phone numbers, my computer screen would state "non-published" where the phone number would be. I couldn't unmask it, either, so I couldn't give it out by accident or be talked into giving it out.
When I worked in customer service and collections, we could see non-published phone numbers because telephone numbers make up the account number. So if someone who had a non-published number called in, they had to give me the complete account number, which included the phone number, in order for me to assist them. I never gave out information without verifying with whom I was speaking first. Everything we did was regulated, so if I didn't follow procedure and verify the caller, I could get fired.
The only way a police department or government agency could get a hold of phone records was by subpoena. We even had a special procedure and department for handling them. In all my years, I only gave out the number to our subpoena department once. A police officer called and asked for it. Unrelated to that request, our office was involved in one local murder investigation. My manager testified as an expert witness at a murder trial explained how we knew a phone call was made from where it was made.
Our internal phone records were different than the phone bill a customer received. They contained more detail than the bills, like local calls made to and from the number. We had that information, but local calls weren't itemized on the bill except by special request, because, in my territory, most customers had unlimited local calling. They could have an itemization for a small fee, but most didn't want it. Even folks with metered service didn't want to pay the small fee to itemize their local calls (it was under a buck a month back then).
Please note, every state's local phone service is/was billed differently, determined by each state's public utility commission. What applied in my customer service territory did/does not apply to other areas.