The Swiss were the stronger side for spells of the match and deserved to be level when Ronaldo's first-half free-kick was cancelled out by Ricardo Rodriguez's penalty.
"Congratulations to Portugal," Petkovic said afterwards, as quoted by UEFA.com. "They had street smarts, they had the cherry on top of the cake and that made the difference. Four shots, three goals.
"On the one hand, we were up against a very strong opponent, but over 90 minutes we showed we're a strong team and that we can make life for a top side difficult, too.
"We were trying to keep the score; we had the chance to get a second but didn't take it. We got outnumbered at the back and conceded. Their top player made the difference."
Switzerland's penalty was awarded in remarkable circumstances, with referee Felix Brych penalising Nelson Semedo for a trip on Steven Zuber after a VAR review, having initially given Portugal a spot-kick for a foul by Fabian Schar on Bernardo Silva.
"The foul wasn't that clear – the penalty we were given – but it was the right decision and in conformity with the rules and the referee did a very good job," was Petkovic's assessment.
Xherdan Shaqiri, who impressed for a Switzerland side that will now contest the third-place play-off, thinks his side must learn to be more ruthless.
"We were the better team, for sure, but Ronaldo decided the game. This is football sometimes," said the Liverpool man.
"We can't always play well and lose. We have to learn from our mistakes and do better next time."