Courts and police can and should be private entities obviously. Their aren’t any reason for these particular services to not exist into a free market.
Private courts already exists and it works, and their are also already more private security agents in the world than policemen.