I don't have answers, only more questions:
  • Are you sure it's even a coding issue?
    Doesn't going over 2GB put you into another category of card speeds?
    Are PIC18Fs even fast enough to process these I/Os?

For example:
https://www.spypoint.com/en/blog/41/...-types-classes

I'm sure the larger/faster/newer PICs can do it, but I know nothing about them except Microchip advertisements.

Robert