Okay yeah trying this out further, this works fine in newer version of Unity, but in 5.3.4 this method doesn't work. If I could pinpoint the exact version of Unity where this breaks, I could use platform-dependent compilation to fix this, but right now that's not really good.
From that bug report, I guess I can assume it's 2018.1? I'll try implementing this, and see if it ends up cropping up in different versions. This wouldn't be the first "by design" bug to hit STM