This is to inform anyone else that encounters this problem.
I was trying to read the program once registers located in the FTFE device.
When I tried accessing the FTFE device from a bareboard application I could read the registers without a problem, but when I tried accessing them from a MQX application I couldn't.
After debugging this problem for a few days it turns out the the FTFE device cannot be accessed when the MCU is set to run in HSRUN mode.
The FlashX driver does not have any mechanism to work around this problem so every access to the FTFE device in HSRUN mode will end up in error.