Create material node tree using script
Answering my own question ...

Once it is created, the node names are different. So you create a node using, e.g. ShaderNodeMixShader, but after that it is called 'Mix Shader' (i.e. as it appears in the node panel).