He meant literally. Read all of John 6 and you will see that Jesus said,
"what if you were to see the Son of Man ascending to where He was before?" And he mentions that He is bread 7 times in John 6. So when they were asking “how can He give us His flesh to eat” that is what He said. And then He goes on to say that His flesh is not dead but is Alive in Spirit. But we still have His Flesh Subtantially and Spiritually because He said that His Flesh is Real Food and His Blood is Real Drink.
Jesus let them walk because He knew that they knew what Jesus was talking about and that was literally because His flesh was going to be substantial for us to eat.
The greek word that was used acutally means to chew or to munch. Jesus would not have used those words if He didn’t mean to eat His Flesh in a real subtantial way.
Jesus told us that He was going to be with us until the end of time and He keeps His promises. He is here
substantially with us and you can see Him in every tabernacle of every Catholic Church and in every Monstrance during Adoration.
Jesus let them walk because they wanted to see another miracle, and were concerned about filling their stomach with more food, rather than being spiritually full with Christ. The bread of life that was right in front of them.
**
John 6
26 Jesus answered them and said, “Most assuredly, I say to you, you seek Me, not because you saw the signs, but because you ate of the loaves and were filled. 27 Do not labor for the food which perishes, but for the food which endures to everlasting life, which the Son of Man will give you, because God the Father has set His seal on Him.”
28 Then they said to Him, “What shall we do, that we may work the works of God?”
29 Jesus answered and said to them, “This is the work of God, that you believe in Him whom He sent.”
30 Therefore they said to Him, “What sign will You perform then, that we may see it and believe You? What work will You do? 31 Our fathers ate the manna in the desert; as it is written, ‘He gave them bread from heaven to eat.’”[d]
32 Then Jesus said to them, “Most assuredly, I say to you, Moses did not give you the bread from heaven, but My Father gives you the true bread from heaven. 33 For the bread of God is He who comes down from heaven and gives life to the world.”
34 Then they said to Him, “Lord, give us this bread always.”
35 And Jesus said to them, “I am the bread of life. He who comes to Me shall never hunger, and he who believes in Me shall never thirst. 36 But I said to you that you have seen Me and yet do not believe.
**
He was speaking about Himself, standing right in front of them, and they did not believe, they just wanted some more food.
That is why Jesus let them leave, not because they did not understand anything about Communion. They were so hungry, that all they understood was that Jesus was telling them to eat Him, instead of understanding that Jesus wanted them to believe in the one the Father had sent.