Our motormouth, Deadpool, has been a skilled fighter, a lover, and silly, sort of. But then visiting Logan's grave in hopes that he can actually resurrect that angry mutant with adamantium claws is just pure plain ridiculous. Bringing actors who played dead characters back isn't an issue for the Marvel Cinematic Universe (MCU) now that the multiverse is here, but then this scene wasn't needed.
The beginning of Deadpool & Wolverine sees Wade Wilson trying to dig up Wolverine's grave as he thinks he is the anchor being of his earth. Without him, all will be lost. So he pulls Logan - or whatever was left of him after 2017's Logan - out of the grave and has a final chat before soldiers from the Time Variance Authority (TVA) arrive.
Now it is understandable that he was afraid that he might lose his world, but visiting Logan doesn't make sense. Especially when he already knew he could not bring the Wolverine back.

Why wouldn't Deadpool know that Logan cannot be resurrected?
Deadpool is among the few characters in the MCU who can break the fourth wall and talk directly to us about both real people and the fictional worlds that he inhabits. He even knows that Stan Lee isn't with us so there's no way he didn't know he couldn't resurrect Logan.
Though there are instances that might've led the Merc with a Mouth to pursue this. You see, Wolverine is someone who survived the Atomic Bomb in The Wolverine (2013), and in the comics, he was brought back to life from a single drop of blood.
But that still doesn't explain how he was hoping for a resurrection when Logan was dead. Deadpool is one of the smartest characters to have appeared in all of Marvel; he would know this. Logan was a character that couldn't die... but he did. That doesn't mean he can suddenly be resurrected. That said, he could've been acting on his emotions following his realization that his world is ending.

But there's a silver lining to it
Now that he has dug up the adamantium clanking Logan skeleton out of his grave, what to do? So the TVA adversaries arrive just in time, play time. The questionable scene outright becomes one of the most thrilling action sequences that fans will remember for decades as it evolves into the iconic opening credits sequence in which Deadpool battles the TVA, all while dancing to NSync's "Bye Bye Bye". And then there's that moment when Deadpool himself becomes a Wolverine, sort of, and that's just Marvel-ous.
What's more interesting about this scene is the kind of work that went in there to create it. There's an entire portion dedicated to explain it in Assembled: The Making of Deadpool & Wolverine, from buying a skeleton to exploring how every single bone can be a lethal weapon against the enemies.
Who would have thought that this scene in particular would have become one of the most talked-about in the whole movie. The power of Marvel... even when it doesn't always make sense.