If a variable is not bound then str(...) will cause an error on evaluation and the whole BIND fails.
COALESCE
can be used to give default values to expressions.
bind ( COALESCE(?firstName, "") As ?firstName1)
bind ( COALESCE(?middleName, "") As ?middleName1)
bind ( COALESCE(?lastName, "") As ?lastName1)
bind (concat(str(?firstName1),str(?middleName1),str(?lastName1)) as ?name