In the chapter "I Plunge to my Death", while Percy is fighting Echidna and her Chimera, his sword falls from his hand into the water and doesn't return to his pocket.
My whole leg was on fire. I tried to jab Riptide into the Chimera's mouth, but the serpent tail wrapped around my ankles and pulled me off balance, and my blade flew out of my hand, spinning out of the hole in the Arch and down toward the Mississippi River.
I managed to get to my feet, but I knew I had lost. I was weaponless. I could feel deadly poison racing up to my chest. I remembered Chiron saying that Anaklusmos would always return to me, but there was no pen in my pocket. Maybe it had fallen too far away. Maybe it only returned when it was in pen form. I didn't know, and I wasn't going to live long enough to figure it out.
Then in the next chapter "I Become a Known Fugitive", he had to explicitly pick up riptide from the ocean floor.
I waded toward Riptide and grabbed it by the hilt. The Chimera might still be up there with its snaky, fat mother, waiting to finish me off. At the very least, the mortal police would be arriving, trying to figure out who had blown a hole in the Arch. If they found me, they'd have some questions.
I capped my sword, stuck the ballpoint pen in my pocket.
Do the books ever clarify the actual reason it happened? I can't seem to believe that it was either of the reasons Percy thought of; because later in the series in "The Titan's Curse" chapter titled "I Put On A Few Million Extra Pounds" the following is stated:
Atlas was taking his time coming toward me. My sword was gone. It had skittered away over the edge of the cliff. It might reappear in my pocket—maybe in a few seconds—but it didn't matter. I'd be dead by then. Luke and Thalia were fighting like demons, lightning crackling around them. Annabeth was on the ground, desperately struggling to free her hands.
"Die, little hero," Atlas said. He raised his javelin to impale me. "No!" Zoe yelled, and a volley of silver arrows sprouted from the armpit chink in Atlas's armor. "ARGH!" He bellowed and turned toward his daughter.
I reached down and felt Riptide back in my pocket.
Since, it returned to his pocket after falling off the cliff, I'm assuming his earlier theories don't stand true.