A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
We would need to see a repro that demonstrates the issue. The repro would have to create the databases, the user and the role.
Most likely when you test it, you will find that the result is the same on SQL 2016 and SQL 2019.
My guess is that the difference you are seeing is due to that permissions are set up differently.
But as I said, provide a repro, if you want us to take a closer look.