Difference between に and で in e.g. 痛みに歪んだ顔


Do they both just state the reason, if not how are they different?

痛みに歪んだ顔 vs 痛みで歪んだ顔




Both are natural, and they mean exactly the same thing. I somehow feel the
former is slightly more literary or "refined", but I cannot explain why and
other people may not agree with me.

