Flash programming routine must execute from RAM ( or EEPROM or another FLASH bank). CPU can't read or execute from flash bank being programmed. As soon as you write a one to CBEIF flag, flash programming starts, and CPU stops being able to read data and also execute code from bank you pointed your programming routine to. CPU will be able to read flash and execute from it after flash module sets CCIF flag, So you must run somewhere else (for example in RAM) from FSTAT=0x80 to CCIF==1.
It doesn't matter what is your data source. CPU hangs when you try to execute code being in the same bank, you are trying to program a part of.