Using a USB-C connector to flash two devices

I have a design that uses two ESP32 C3s in one housing and I had the idea that I could use the two USB2 connections within the USB-C connector to flash one or the other ESP depending on which way around the connector was inserted.

Does this sound feasible?

If I connect the USB pins of one ESP32 C3 to DP1 and DN1 and the other to DP2 and DN2 then, in theory, when I rotate the connector 180 degrees it should connect to the USB of the other ESP?

In normal operation the USB socket will only be used to power the devices.

Maybe if you wire the connectors that way, but I would not assume they are that way now. Use a VOM to verify.
As far as I know, you can plug the cable in any way you want, and everything is fine. There might be a single pair that changes, so you can interrogate them to determine which way it is plugged in, but I am going from memory.

From what I can see, the standard USB-C male to male cable uses A6 and A7 for the USB 2.0 D+ and D- and B6 and B7 are not connected.

The USB-C socket on the device connects the D+ and D- from the respective pins together so that it will work which ever way around you insert the plug.

As I am designing the PCB I think I can use A6 and A7 for one ESP32 and B6 and B7 for the other and I can then flash each device by turning the plug 180 degrees.

Ofcourse I will have to figure out the orientation and mark the cable but it will only be used for the initial flashing as it will br OTA after that.

I just discovered that I have always been looking at the USB-C receptacle pinout and NOT the plug. Now I understand what you are attempting. For any others that might be confused here are both.

Theoretically, yes.