What was your call to pcre2_pattern_info()? If it was pcre2_pattern_info(pattern, PCRE2_INFO_JITSIZE, NULL) you will get a non-zero result, because when the third argument is NULL the value returned is the size of the variable needed for that particular data item. Even if PCRE2 was compiled without JIT support, it is still happy to tell you how big a variable would be required to hold the JIT size data. I suppose this could be changed to give an error return - there doesn't seem to be an existing "JIT not supported" error, but one could be invented. Is is worth it?
If your third argument was not NULL, I am bewildered, because the code explicitly returns zero when JIT is not supported.