Dear group,
I am running a single-season occupancy model to investigate the occupancy patterns of Macaca maura along their complete geographic distribution in Sulawesi (Indonesia). We collected data in 206 sites (1 site = 2 km²) along the distribution of the species, which is around 20.000 km². However, I'm finding some issues related to the goodness-of-fit test, as the Bayesian p-values are 0 or <0.05, even with spatial factor occupancy models (spPGOcc). The only way that I have to obtain Bayesian p-value ≈ 0.5 is by including sampling location ID (sl) as a random effect in the detection model. But if I do include the random effect, the random effect seems to have a strong effect on the model. Thus, I am not sure if including the random effect would be recommended in this case, or if I should include another random effect different from sl. Prior to running the models in spOccupancy, I used unmarked, where I did not find goodness-of-fit issues with the McKenzie-Bailey Test. Also, if I include the random effect, the results between unmarked and spOccupancy models vary significantly, especially for selecting the best model based on WAIC.
These are the formulas for the best model (in unmarked I was able to include an interaction between treeheight and edge in a stable model):
occ.formula = ~ scale(treeheight)+scale(edge)+scale(hfi),
det.formula = ~ scale(slope)+I(scale(slope)^2)+scale(forest250)
And for the spatial factor, the best setting was using 5 neighbors.
Simple Occupancy Model:

Random Effect Occupancy Model:
Spatial Factor Occupancy Model:
What do you think would be the best approach? Do you recommend any changes in the modeling to try to find a better fit for the models?
Thank you very much for your help,
Best
Víctor