Godot is telling you mat is null. null means the variable contains nothing.
onready var mat = self.get("material/0")
onready code will run just before your _ready function. You did not assign material 0 at this time, so mat will contain null.
self.set("material/0",SM)
Later you are assigning material 0, but the mat variable will still be null. You have to write mat = self.get("material/0") AFTER you set the material slot, or better, just write mat = SM.
Also, you don’t have to use set or get. Properties are described in the doc to do this. Just write mat.shader = load("res://Mshader.shader"), or set_surface_material(0, SM) (no need for self either).
In your last screenshot, you are showing the Local scene tree. This is the scene as it is before it runs. If you want to see properties of your node while it is running, select Remote at the top of the scene tree (and wait for a bit, it can take some time to update).
Also, you are getting an error later in your script. You are calling load with a ViewportTexture, but load expects a path to a resource instead.