You can try to argue that Messi and Ronaldo didn’t have good enough teams to win the World Cup (although I disagree as stated above - I think people make too many excuses for them in that regard). What you cannot logically argue is that they didn’t have good enough teams to enable them to score a bleeding goal in the knockout rounds of the World Cup.
Yes it should have happened, but once again let's see what games they played:
2006 Ronaldo: Netherlands (sub off at 33' because of injury), England (with extra time), France, (Germany)
Team scorers in this stage: Maniche (1), Nuno Gomes (1)
Tournament best scorer: Klose (5)
2010 Ronaldo: Spain
Team scorers in this stage: none
Tournament best scorers: 4 different players with 5 goals
2014 Ronaldo: Portugal didn't qualify for knockout stages
2018 Ronaldo: Uruguay
Team scorers in this stage: Pepe (1)
Tournament best scorer: Kane (6)
Ronaldo: 0 goals in 5 games, including 1 extra time and 33 mins in another game
Ronaldo: 0 goals in 5,70 games
Other team players scored 3 goals in 6,33 games (0,47 goals per game)
2006 Messi: Mexico, Germany (played only 36' in the Mexico game, 6' regular + 30' extra time)
Team scorers in this stage: Crespo (1), Maxi Rodríguez (1), Ayala (1)
Tournament best scorer: Klose (5)
2010 Messi: Mexico, Germany
Team scorers in this stage: Tevez (2), Higuain (1)
Tournament best scorers: 4 different players with 5 goals
2014 Messi: Switzerland, Belgium, Netherlands, Germany (extra time in 3 games)
Team scorers in this stage: Higuain (1), Di Maria (1)
Tournament best scorer: James Rodríguez (6)
2018 Messi: France
Team scorers in this stage: Di Maria (1), Mercado (1), Aguero (1)
Tournament best scorer: Kane (6)
Messi: 0 goals in 7 games, including 36 mins in another game and 3 extra times
Messi: 0 goals in 8,40 games
Other team players scored 11 goals in 10,33 games (1,06 goals per game)
: Wales, France, Sweden (scored in the 3 games, 6 goals)
Team scorers in this stage: Pelé (6), Vavá (3), Didi (1), Zagallo (1)
Tournament best scorer: Fontaine (13)
1962 Pelé: England, Chile, Czechoslovakia (didn't play in any of these games)
Team scorers in this stage: Garrincha (4), Vavá (4), Amarildo (1), Zito (1)
Tournament best scorers: 6 different players with 4 goals
1966 Pelé: Brazil didn't qualify for knockout stages
1970 Pelé: Peru, Uruguay, Italy (scored in the final only, 1 goal)
Team scorers in this stage: Jairzinho (3), Rivelino (2), Tostão (2), Clodoaldo (1), Gérson (1), Carlos Alberto (1), Pelé (1)
Tournament best scorer: Muller (10)
Pelé: 7 goals in 6 games
Other team players scored 26 goals in 9 games (2,89 goals per game)
1970 Muller: England, Italy, (Uruguay) (scored in the first 2 games, in extra time only vs both, total of 3 goals)
Team scorers in this stage: Muller (3), Beckenbauer (1), Seeler (1), Schnellinger (1), Overath (1)
Tournament best scorer: Muller (10)
1974 Muller (host): Netherlands (total of 1 goal)
Team scorers in this stage: Muller (1), Breitner (1)
Tournament best scorer: Lato (7)
Muller: 4 goals in 4 games, including 2 extra times
Muller: 4 goals in 4,66 games
Other team players scored 5 goals in 4 games (1,25 goals per game)
Let's look at the details (I'm counting only knockout stages of the WC except for the tournament best scorer above):
Pelé basically scored only in 1 world cup, in 1958, in 1962 he was champion without even playing in the knockout stages, in 1966 he didn't qualify off the group stages like Ronaldo in 2014 and in 70 he was champion but "only" scored a goal in the final.
As you can see Brazil was just an insane studded team in this era, excluding Pelé the other players scored 26 goals in only 9 games! Pelé was not an outlier, he was just another part of those great teams, he wasn't even "needed" to win it (like in 1962).
Muller played very few games as in 1974 (West Germany was the host) the group stage jumped directly to the final or 3rd place game, he played that final game and scored in a 2-1 game. In 1970 he scored 3 goals but all in extra times (if you want to be partial he didn't score in regular time), he was anyway the tournament best scorer with 10 goals.
The rest of the team scored just a little as much as him (5 vs 4).
Messi barely played in 2006, his teammates score basically 1 goal per game which is kinda risky as you might easily lose or draw (and go to penalties) if you concede 1 goal.
Argentina went 4 times into extra time in just 9 games.
Ronaldo basically can't count on anyone else, Portugal scored just 3 goals in 6 games and if you exclude the 3rd place game then Portugal scored only 2 goals in 5 games, that's less than 1 goal every 2 games. Basically Portugal is either super defensive or very bad in attack, or both.
This is why you can't compared Pele's teams with Ronaldo's teams, Brazil has many players available to help winning games and scoring for fun, Ronaldo has to struggle uphill as his team basically is built to defend and/or unable to help him in attack. He was also unlucky by the opponents he faced: Netherlands during wartime, a good England defensive bloodbath game, a very good defensive France, a super dominant Spain that was champion without conceding goals in this stage and another very good team in defence (Uruguay).
So basically your idea doesn't seem to hold: Portugal was only able to get farther by being super defensive (mind you, less than 1 goal every 2 games!) and basically being almost impossible to score that "simple" bloody goal you mentioned.
Is this an excuse? I don't know, but it speaks for itself.
I think both Ronaldo should have scored in the knockout stages already but when you look at their teams, how defensive they were and the opponents they faced, I don't think it's a major failure on his part.
Now another useless just for mind thought exercise: what would happen if you switched Ronaldo and Pelé on their teams?
Can Ronaldo score when inserted in a very dominant and high quality offensive team?
Can Pelé score when he plays 40 m away from the net against good defensive teams with Postiga or Hugo Almeida as partners?