Patricia 4 will only play a sub-optimal move if the thread_info.cp_accum_loss variable is filled up. Unfortunately, (thread_info.game_ply > 5) is a condition required to fill up that variable. Depending on how the position is fed to Patricia 4, the game_ply may not be correct. For example, take this position:
position fen rnb5/4k1r1/p1p1p2Q/1q2P1p1/4B3/2P1B2P/1P3PP1/R3R1K1 b - - 0 18 moves e7f8 h6h8 f8f7 a1d1 b8d7
Patricia 4 will not refill the cp_accum_loss variable for this position because the game_ply is '5' in this instance, which is incorrect (should be 23). Patricia 4 needs to be smarter about how to calculate the game_ply so will not play perfectly depending on how the UCI position is fed to the engine.