The microcontroller we are using is IMXRT1024 and platform to build the code is MCUXpresso IDE. While we are try to run our application code in flash memory, Active Fault error pops up as shown in the below picture.

When we try to run the same code in SRAM, we don't find any such issues and functionality of the code is also fine. On further debugging we found, when commenting two lines of code (which is used to configure a particular GPIO pin), we were able to flash successfully without any active fault errors.
The following are the couple of lines we commented to get rid off the issue.
IOMUXC_SetPinMux(IOMUXC_GPIO_SD_B1_05_GPIO3_IO25,0U);
IOMUXC_SetPinConfig( IOMUXC_GPIO_SD_B1_05_GPIO3_IO25, 0x0170A1U);
An addon information is we similarly configure 5 such GPIO pins, and they don't cause any issue.
What could cause such active fault errors and is there any possibility to get rid off the issue even while we configure the above mentioned GPIO pin?