And then there's another problem. Or actually the same problem.

Those banksel atans ...

Somehow in C, the atans table that's in Flash by the DW statements, gets copied to RAM. Then it uses FSR0 to read the array. But it's strange that it uses the same label.

I think you'll have to create a WORD array in PBP and load it with the values from the atans data.
Either read the data or just have a few atans(0) = xxxx statements.

If the array's in BANK0 then you still won't need the banksel statements.

Mañana