Re: pic 18f26k40 bootloader
Most likely your program along with the bootloader are consuming more resources than the device has to offer.
Lack of resources could take the form of Flash, SRAM or EEPROM.
Another possibility, during the loading process, your program is in contention with resources. i.e., sections of write protected flash, temporary resources in SRAM, already utilized by the bootloader.
It is difficult to ascertain the exact cause without more information concerning the bootloader and your program.
BigDog