Two days after saying he was “surprised” Joshua Garnett didn’t practice, 49ers head coach Kyle Shanahan provided more specifics about the knee injury that’s kept the right guard out of five straight practices.

Shanahan said Friday that Garnett is seeking a second medical opinion because he still has discomfort in the same knee that required surgery last year. Garnett, a 2016 first-round pick from Stanford, banged his knee with a teammate during the third practice of training camp.

“There is concern,” Shanahan said. “Josh said that he doesn’t feel right, so it’s always worrisome when a player doesn’t feel right. Josh is getting a second opinion. We’ll wait until our doctors talk with the other people, and we’ll see the conclusion they come to.”

Last year, the 49ers placed Garnett on injured reserve before the season opener, although he could have returned around midseason. He used his time off to rehab and drop weight in an effort to become a better fit for an offensive scheme that requires movement skills from linemen.

“Josh went through a lot last year with his knee and took a season off treating it right and getting himself ready to play,” Shanahan said. “He came in here, had a good OTAs and a couple good practices, and he hit his knee. And it’s worried him. And I understand that, but he doesn’t feel right. We’re trying to figure out what it is and, hopefully, we will.”

At the start of training camp, Garnett was expected to battle Jonathan Cooper for the starting right guard spot. Cooper had offseason knee surgery and has yet to participate in team drills, leaving Mike Person to take most of the snaps at right guard since Garnett was sidelined.

More injuries: Both cornerback Richard Sherman (hamstring) and defensive end Cassius Marsh (groin) left practice early after experiencing tightness, Shanahan said.

They joined a group of spectators that included defensive end Jeremiah Attaochu (groin), wide receiver Dante Pettis (groin) and cornerback Jimmie Ward (hamstring).

The 49ers did receive good news regarding tight end Cole Wick (knee), who was carted off the practice field Thursday. Wick did not sustain a serious injury and is considered day-to-day.

Sloppy session: The 49ers don’t practice Saturday. That’s probably a good thing.

On Friday, Shanahan brought the team together early in practice after a sloppy opening.

“We had to lock in,” Shanahan said. “We had to tough through this. I didn’t want to waste a day. I think guys were working, but I want people mindful in everything they do and not going through the motions so we’re getting better out there, not just getting tired.”

Shanahan said the missed assignments weren’t limited to his players.

“Even coaches — coaches (were) getting off script,” Shanahan said. “Having the wrong personnel in there and things like that. ... It was everyone.”

Eric Branch is a San Francisco Chronicle staff writer.