EDIT: I managed to solve my problem, but I still have some questions if anyone can enlighten me.
From the documentation, I would have thought these two methods do the same thing:
meshInstance.set_surface_material(0)
Description: Sets the Material for a surface of the Mesh resource.
and
meshInstance.mesh.surface_set_material(0)
Description: Sets a Material for a given surface. Surface will be rendered using this material.
And presumably for setting the material, but only using the MeshInstance works
meshInstance.get_surface_material(0)
Description: Returns the Material for a surface of the Mesh resource
and trying to use the mesh value to get the material does not
meshInstance.mesh.surface_get_material(0)
Description: Returns a Material in a given surface. Surface is rendered using this material.
I get null returned. I expected them to return the same material? When I say I get null, I am getting this from the error 'on base: 'null instance'', and also by the editor when I look at local variables when the error occurs. However if I do print(typeof(materialClicked)) - I get 17. I would have thought I'd get 0 'Variable is null' - https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#enum-globalscope-variant-type)?