@bobk are you using a certified usbc to lightning cable from Apple? Or is it a 3rd party aftermarket?
Some aftermarket cables cannot sustain or output the required power to utilize power delivery hence why it doesn't work. The power port is designed to prevent excess current and detect fault as to not damage your device.
With that said, it also has power iq technology and voltage boost to measure and determine the fastest way to charge your device, so it can still charge when using a proper cable capable of handling the current and power output