The drivers and tuning should be 100% the same, so given a perfect seal from both, they should sound identical.
Yes and No
The issue is ear canal resonance will change per product (CIEM v/s IEM).
Quick example.
Take 3 glasses (same in size and make)
1 glass empty
1 glass 1/4 full
1 glass 1/2 full
Tap each glass, you will hear a difference in tone quality.
That tone qulaity represents the natural resonance of the glass in a certain condition, empty, 1/4 full, 1/2 full
The glass represents the ear canal, the water represents CIEM canal length/ material, and it also represents the IEM canal/ear tip
So the point is, even if the sound is the same mearsured at the mouth of the CIEM or IEM, due to the canal resonance being impacted differently by either a CIEM or an IEM, there very well may be a difference in percieved sound quality.
Now, does that mean that a CIEM sounds better than an IEM?
Nope, just because there may be or may not be a percievable difference, only the listener can determine which sounds better to them.
They may feel that the IEM sounds better...... or may feel that the CIEM sounds better.
Different strokes for different folks.