There could be multiple images in the PSoC device flash. Hence, bootloadable validation calculates checksum from the application image start address till the valid end, instead of the device flash end. Bootloader access start and end address from the metadata region.
It seems that (N-2)nd row is not part of the bootloadable image in your application. Please change the test flash row to be part of bootloadable region and let me know if it helps. You can refer to Bootloader_ValidateBootloadable API for more details on checksum validation.