I dont see why he would reveal himself in that moment but not when they were 100% captured and inside a cell by Kaido and Orochi for the boiling. It just just seem very odd for the duo to suddenly decide this time is the definitely the one where everything is impossible to fail and they just have to prematurely gloat.
.
In both instances Kanjuro had no intention of revealing his identity on his own, he was perfectly fine with dying with the other Scabbards. The only reason he revealed it the 2nd time around when they were at sea is because Orochi told him he could stop with his performance and bring Momo to him. He can't exactly kidnap Momo without it being obvious he's the traitor, so you may as well get some quick gloating in there.