It is an excellent question which shows good, rational thinking and a search for the correct understanding.
I wrote an article about this 32 years ago in a Bible translation publication. It can be read here: https://www.academia.edu/749504/Did_Peter_enter_the_boat_John_21_11_
Let me give a "short" recap of the main points. (As short as I can in order to cover the essential points). We need to look at the whole passage 21:1-11 to get the context.
“I’m going out to fish,” Simon Peter told them, and they said, “We’ll go with you.” So they went out and got into the boat, but that night they caught nothing. (21:3 NIV)
Peter was frustrated and disillusioned. Jesus had not been the kind of Messiah they had expected and he himself had denied his master 3 times. He is now leaving his calling as a disciple of Jesus and going back to fishing. But what happened? They caught nothing at all. That was a miracle, staged by Jesus for what follows. It was the same stage as in Luke 5 where Peter received his calling as a follower of Jesus.
He [Jesus] said, “Throw your net on the right side of the boat and you will find some.” When they did, they were unable to haul the net in because of the large number of fish. (21:6 NIV)
The scene from Luke 5 is repeated although with different fishing tools. Here they use a cast net. 7 strong fishermen were unable to haul the net up into the boat. We are later told that there were 153 large fish in the net. It might have weighed about 300 kilos. So, what did they do to the net? They tied it to the rear end of the boat so that it was being dragged along in the water as the boat moved to shore.
Therefore that disciple whom Jesus loved saith unto Peter, It is the Lord. Now when Simon Peter heard that it was the Lord, he girt his fisher's coat unto him, (for he was naked,) and did cast himself into the sea. (21:7 KJV)
Here the translations start to go astray, so let me go to the Greek:
Σίμων οὖν Πέτρος ἀκούσας ὅτι ὁ κύριός ἐστιν τὸν ἐπενδύτην διεζώσατο, ἦν γὰρ γυμνός, καὶ ἔβαλεν ἑαυτὸν εἰς τὴν θάλασσαν
So, when Simon Peter heard that it is (was) the Lord he girded himself with the outer garment, for he was gymnos, and threw himself into the lake. The word for gird oneself is a very specific word that cannot be translated "put on". It can only be understood by appreciating the clothing used at the time. The common clothing was a long inner garment without sleeves reaching almost to the ankles, sometimes called a tunic. Then there was an outer garment:
ἐπενδύτης - a garment put on over another garment, outer garment (BDAG).
The outer garment was even longer than the inner garment and usually had long sleeves. It was made of more heavy and warmer material. People usually wore a belt which was used to gird oneself. This means pulling up one's long clothes and tying the belt around the waist to hold the clothes up in place. In this way, the legs would be free to run, if needed.
The text tells us that Peter had taken off his outer garment, which was lying in the boat. It is not practical to work with a cast net and pull a net up from the water, if you wear a heavy coat with long sleeves. So, the gymnos here does not mean "naked", but wearing only the undergarment, his work clothes. Because the outer garment had long sleeves, he could use those sleeves instead of a belt to pull up the inner garment and tie the waist with those sleeves. I sometimes tie my sweater around the waist using the long sleeves.
But why gird himself if he was intending to swim to the shore? You could suggest that it was to give freedom to move the legs. But if he had tied the sleeves of his long garment around the waist, the rest of the garment would drag behind him. It would be pretty impossible to swim like that, but it would be possible to walk on the bottom of the lake. And the text says nothing at all about swimming nor reaching the shore nor him wanting to see Jesus. Why? Because he had no intention of swimming to shore. He was in no hurry to meet the master he had betrayed. He was utterly ashamed of himself, mainly because of his denial, but also because he had been "caught" by Jesus resigning as a disciple. No, he wanted to busy himself with another task that was important to him: Trying to get the net full of fish safely to shore without it being torn. So, he jumped into the water in order to help the net not to be torn against the bottom of the lake as they were now dragging the net along after the boat. This incident took place near Bethsaida at the Northern end of Lake Galilee where the Jordan River had made a huge flat delta area. It would be the only place in the lake where one could walk far out into the lake. John does tell us that they were not far from the shore. Why does he tell us that? Probably to show that Peter could actually stand on the bottom of the lake at that point. If not, he could hold on to the rail of the boat until he could reach the bottom. Let us compare with next verse:
οἱ δὲ ἄλλοι μαθηταὶ τῷ πλοιαρίῳ ἦλθον, οὐ γὰρ ἦσαν μακρὰν ἀπὸ τῆς γῆς ἀλλὰ ὡς ἀπὸ πηχῶν διακοσίων, σύροντες τὸ δίκτυον τῶν ἰχθύων
But THE OTHER DISCIPLES by the boat came, (you see, they were not far from the land but about 200 cubits,) dragging the net of fish.
They were all united in coming to the shore while dragging the net. The contrast shown by the Greek fronting of "the other disciples by the boat" is between Peter coming in the water and the other disciples coming in the boat.
Now we need to move to verse 11:
ἀνέβη οὖν Σίμων Πέτρος καὶ εἵλκυσεν τὸ δίκτυον εἰς τὴν γῆν
So, Simon Peter went up, and drew the net to (the) land (KJV).
This is where almost all versions go astray, because they have made the wrong assumption that Peter swam to shore, so that he would already be on the shore. Therefore, they do not know what to do with the Greek word that means "going up". It is used when a person goes from water up on land or moving up a hill, but not used for entering a boat (that would be embainō rather than anabainō). In desperation, the translations add a word that is not in the text. ESV says: "So Simon Peter went aboard and hauled the net ashore." NIV: "Simon Peter climbed aboard and dragged the net ashore." CEV: "Simon Peter got back into the boat and dragged the net to shore." The LIving Bible realized the problem of going up in a boat at this point, so it says: "So Simon Peter went out and dragged the net ashore." The problem here is that it is the opposite of the text. The verb is not "go out (into the lake)", but "go up (from the lake)".
Entering the boat is not only wrong, but makes no sense. Since the net would be tied to the rear end of the boat and therefore still hanging in the water, why would he enter the boat to haul the net ashore? He could certainly not pull it up into the boat as it was too heavy. And if he wanted to pull it further up on the shore, why enter the boat?
No, Peter is still busy with the fish, because he is ashamed to face his master. He could pull it up a bit, since part of the weight was still carried by the water and it was a very gradual slope. At least long enough to get one of the fish and secure the net. It is only later in the chapter that Peter is restored 3 times by Jesus and given a second chance to be a follower of Jesus.
So, when read in the original context of the clothing used, the situation at the lake, the miracles of no catch and then a huge catch, the link to the first calling of Peter, and his apparent disillusionment (going back to fishing) until he was restored, it all makes perfect sense.