If this instruction is checking that the scalar generated is less or equal than the order of the subgroup, then babyjub.p should be replaced by babyjub.subOrder (you can check both parameters at https://github.com/iden3/circomlib/blob/master/src/babyjub.js).
https://github.com/iden3/iden3js/blob/c2844797f553efdb4762d46016c336cde9ec5524/src/crypto/babyjub-utils.js#L60-L62
If this instruction is checking that the scalar generated is less or equal than the order of the subgroup, then
babyjub.p
should be replaced bybabyjub.subOrder
(you can check both parameters at https://github.com/iden3/circomlib/blob/master/src/babyjub.js).