I remembered that It did not work when Blender 4.0 Beta is just out, but it works correctly in the latest build of Blender 4.0 Beta, all sockets can be linked correctly by Python script.
Here is the file that works in Blender 3.6.4, the 'ShaderNodeMixRGB' node is created via Python script.
Sorry, I use 'ShaderNodeMixRGB' instead of 'ShaderNodeMix' in Blender 3.6.4, so it works without bug.
I have just tested the code in Blender 3.5.0, the bug is still there, but after I upgraded to Blender 3.5.1, the bug has gone, so I confirmed that the bug has been fixed in Blender 3.5.1, it works…
Sorry I don't have a working script at present, for my add-on is so complicated that I can make a simple testing script from the source code, I guess that the issue may be caused by this…
Sorry I should report the bug in the blender-addons.