Cannot access SMB mounts using scripts - 'No such file or directory'

You will have to mount on a predefined location - then unmount when done.

I created a script a couple of years ago - you could see it for ideas on how you could accomplish your goal

→ [root tip] [Utility Script] GIO mount samba share

And for a modified version see

→ Re: [Utility Script] GIO mount samba share - #3 by pheiduck