This bug is now fixed in the next version of the FITS support module, which will be released very soon, along with a new version of PixInsight. To be fair, the bug was in my code, not in CFITSIO. It has been difficult to find but this problem is now solved.
Sorry for the inconvenience, and thank you for your patience.