I should make it clear, I'm at no point advocating for planning how the story will play out in advance - there's no point in playing the game if the story is completely pre-planned. Personally I think if you want to tell a completely planned story "writing" is a great outlet for this! I'm saying that, if in the moment, you get the feeling that the fun of the table is at stake, it can be worth a fudge.
For me, the most common "fudge" is if I'm running an official module with a random tables, especially encounter tables. I'll usually start by rolling on it, but if I see an option near my result that I think makes a better story in the moment, I'll swap over to it. If there's a cool thing I want the players to see, I'll try and make sure they get to see it over yet another encounter with 2 gargoyles at level 12. (I'm thinking of a real 5e module here!)
There's a bit of a sticking point with the argument "if you ignore the stats, the dude with the +12 might as well have not bothered building a character at all!" - because "if you ignore what the characters say, then the dude who came up with the brilliant argument might as well have not bothered roleplaying." - It's the same kind of argument, and I'm not advocating for either in the general sense. I'm saying "play it by ear". If in the moment you feel that this argument should convince the guard, regardless of the skill of the liar - don't roll the dice. That doesn't mean "don't ever roll the dice" it means that sometimes when you think it fits the story you're telling and the mood of the players at the table, you should just say "okay yes, that works!" Dice rolling is for when there are multiple credible outcomes to a situation, and you want to pick between them with chance.
Many DM's instinctively feel that a player who is creative and who concocts a brilliant believable lie should get some sort of "reward" over a player who just says "I've got a +15 to deception, so I'm just gonna invent a lie that convinces him we're innocent" and rolls. Or as another example, if two characters have +5 to deception, and one tells a great lie while the other tells an unbelievable one, people often feel that the good lie should stand a better chance to work - because that's how it works in stories.
Good roleplay is, of course, always its own reward, but the story feels more immersive if good arguments and good lies "work better" than bad ones in similar circumstances.
If you're the kind of DM who wants stuff like this to matter, but you don't want to just give the players a "free win" you can always implement a "situational bonus" to checks - some DMs will say "I'm going to give you +5 to this deception check because that was an excellent lie" - some DMs might say "Convincing the guard of that like is easier than convincing him of this lie, so the DC is lower" and some might say "that's a really believable lie, so I'm giving you advantage" or "the guard is really inclined to believe this story, so I'm giving him disadvantage on insight" - all of these can let you make sure that good roleplay feels effective in the story. The core books do talk about situational bonuses as something you should consider for checks in general, and they often recommend advantage or disadvantage as the approach. My preferred method is to adjust the DC for a check, or if it's opposed, provide a small advantage or penalty.
As always, everyone should run their table how they want. I'm just talking options. The "right" answer to a question like this is "whatever your table enjoys most", and the "wrong" answer is to stick with a style nobody at your table likes (and the books offer several approaches to these problems, so there isn't a defined "right answer" by the strict reading of the books)
I should make it clear, I'm at no point advocating for planning how the story will play out in advance - there's no point in playing the game if the story is completely pre-planned. Personally I think if you want to tell a completely planned story "writing" is a great outlet for this! I'm saying that, if in the moment, you get the feeling that the fun of the table is at stake, it can be worth a fudge.
For me, the most common "fudge" is if I'm running an official module with a random tables, especially encounter tables. I'll usually start by rolling on it, but if I see an option near my result that I think makes a better story in the moment, I'll swap over to it. If there's a cool thing I want the players to see, I'll try and make sure they get to see it over yet another encounter with 2 gargoyles at level 12. (I'm thinking of a real 5e module here!)
There's a bit of a sticking point with the argument "if you ignore the stats, the dude with the +12 might as well have not bothered building a character at all!" - because "if you ignore what the characters say, then the dude who came up with the brilliant argument might as well have not bothered roleplaying." - It's the same kind of argument, and I'm not advocating for either in the general sense. I'm saying "play it by ear". If in the moment you feel that this argument should convince the guard, regardless of the skill of the liar - don't roll the dice. That doesn't mean "don't ever roll the dice" it means that sometimes when you think it fits the story you're telling and the mood of the players at the table, you should just say "okay yes, that works!" Dice rolling is for when there are multiple credible outcomes to a situation, and you want to pick between them with chance.
Many DM's instinctively feel that a player who is creative and who concocts a brilliant believable lie should get some sort of "reward" over a player who just says "I've got a +15 to deception, so I'm just gonna invent a lie that convinces him we're innocent" and rolls. Or as another example, if two characters have +5 to deception, and one tells a great lie while the other tells an unbelievable one, people often feel that the good lie should stand a better chance to work - because that's how it works in stories.
Good roleplay is, of course, always its own reward, but the story feels more immersive if good arguments and good lies "work better" than bad ones in similar circumstances.
If you're the kind of DM who wants stuff like this to matter, but you don't want to just give the players a "free win" you can always implement a "situational bonus" to checks - some DMs will say "I'm going to give you +5 to this deception check because that was an excellent lie" - some DMs might say "Convincing the guard of that like is easier than convincing him of this lie, so the DC is lower" and some might say "that's a really believable lie, so I'm giving you advantage" or "the guard is really inclined to believe this story, so I'm giving him disadvantage on insight" - all of these can let you make sure that good roleplay feels effective in the story. The core books do talk about situational bonuses as something you should consider for checks in general, and they often recommend advantage or disadvantage as the approach. My preferred method is to adjust the DC for a check, or if it's opposed, provide a small advantage or penalty.
As always, everyone should run their table how they want. I'm just talking options. The "right" answer to a question like this is "whatever your table enjoys most", and the "wrong" answer is to stick with a style nobody at your table likes (and the books offer several approaches to these problems, so there isn't a defined "right answer" by the strict reading of the books)