Every user that executes the stored procedures must have access to the temporary database. You must also grant access to the temporary database for the Dynamic Data Masking user that you use to create the database connection in the Management Console.
To grant access to the temporary database, run the following command:
use <temporary database name>
sp_adduser <user name>