Floundering (verb): to move in an awkward way with a lot of difficulty and effort: to be unsure about what to do or say: to have a lot of problems and difficulties (Merriam-Webster)
Found on Page I, paragraph 3 of The Metamorphosis–> “However hard he threw himself onto his right, he always rolled back to where he was. He must have tried it a hundred times, shut his eyes so that he wouldn’t have to look at the floundering legs, and only stopped when he began to feel a mild, dull pain there that he had never felt before.”
I believe this word in the quote means that after Gregor Samsa realize he has been transformed into an insect, he moves in a difficult way in order to get himself out of bed. Since his arms was nonfunctional anymore, he had to figure out how to use his new body, which consisted of many legs, antennas and an exceptional board body.
Here is my visual interpretation of Gregor trying to roll off his back when he was in his bed.