One way to understand these verses (see Ramban on 5:23) is that the people feared that there was a limit to how long one could survive if G-d spoke to them. The people learned that one could survive a short period of time but they still thought that if G-d had continued to speak, then they would have died.
A second answer is based on the way that humans think, see Kahneman (2011). Humans make decision either intuitively (system one according to Kahneman) or analytically (system two according to Kahneman). If one acts from intuition, then one is more influenced by the immediate events, while with analytic decisions, one takes into account much more factors. From an intuitive approach, the people were focused on the fire (5:22,23), which sacred them. However, from an analytic perspective, the people knew that they were not meant to die since G-d had taken them out of Egypt to make them His people. In 5:21, the people mentioned the fire, but the fire was not the focus of their thoughts, but rather G-d's glory, greatness and voice, while in 5:22 the people were focused on the great fire that could consume them.
These dual emotions are very common. For example, if one goes to a very high building with has a glass extension that one can walk out on and see down below, many people are scared to walk on the glass even though they know that the glass is not going to collapse. If they do walk on the glass, then many people will say I survived walking on this platform but they were scared and do not want to do it again, even though they know they would survive it a second time.
Accordingly, 5:21 can be understood from the analytic perspective (system two) that the people knew that they would live if G-d continued to speak, which meant that they learned that Moshe could speak to G-d and live. However, the statements in 5:22,23 were from the intuitive approach (system one) that the people were truly scared, and hence they asked Moshe to speak to G-d instead of G-d speaking to them, 5:24.
Kahneman, Daniel, 2011, Thinking, fast and slow, New York: Farrar, Straus and Giroux.