Fixed the test to correctly set the parameters and also to first verify that a direct connection works before doing the test via MaxScale.
The test case doesn't reproduce the problem due to MDEV-19811 getting in the way but it is likely to reproduce it once that bug has been avoided.