רמב"ן
Ramban on Exodus 14:10
Q — At the sea, Bnei Yisrael cry out to Hashem ('ויצעקו בני ישראל אל ה'') and immediately tell Moshe they'd rather have died in Egypt. How can the same people pray to be saved and curse the very salvation underway?
A — Ramban offers three readings, each illuminating. (1) Different factions: one group prayed, another denied the redemption. (2) Their emuna in Hashem was intact, but they doubted Moshe — perhaps he had acted from personal ambition, the otot done 'בדרך חכמה' or coincident with Egyptian wickedness. (3) Per the Mechilta's 'תפשו אומנות אבותם' (they grasped their fathers' craft, prayer) — they did pray faithfully, but when the prayer didn't immediately change reality, the שאור שבעיסה (yetzer hara) entered and turned their hearts against Moshe. The chiddush is psychological: the gap between unanswered prayer and present danger is precisely where doubt about a leader enters, even in someone who hasn't lost their emuna in Hashem.
אבל הנכון שנפרש כי היו כיתות, והכתוב יספר כל מה שעשו כולם. אמר כי הכת האחת צועקת אל ה', והאחת מכחשת בנביאו ואינה מודה בישועה הנעשית להם, ויאמרו כי טוב להם שלא הצילם. ואפשר עוד לומר כי היו העם מאמינים בה' ומתפללים אליו להצילם, אבל במשה נכנס ספק בלבם פן יוציאם למשול עליהם... ובמכילתא: תפשו להם אומנות אבותם... ושאור שבעיסה הוא היצר הרע, והיה דעתם לומר כי מתחלה צעקו אל ה' לתת בלב פרעה לשוב מאחריהם, וכאשר ראו שלא היה חוזר... אז אמרו לא נתקבלה תפלתנו ונכנסה בלבם מחשבה רעה להרהר אחרי משה.