Luka! I love the questions and, in considering them, discovered I might design in a bit of a strange way. You'll hopefully see what I mean in my responses to particular questions.
Is failure a punishment or learning opportunity?
In thinking about this question I found myself looking at the games I have designed (and am currently working on) and discovered that failure just… isn't really a thing within the game, except as an end state? I mean this in the sense that at no point do you "fail" exactly, just that you haven't succeeded yet.
In Summit, you progress through finding specific cards in your journey, and not finding them is the closest you come to "failing" before the game concludes, in 3 Shining Motes you lose settlements but can't "fail" until the game itself ends, in The Boulder you lose progress but there's no permanent loss. Even the current game I'm working on, Waning Echoes, doesn't have failure as much as a lack of resources to achieve success or advance your agenda.
The only game I've written that does have conventional failure is also the only one that I based on an existing SRD: The Curse Lingers, using Caltrop Core. There, failure uses a mixed success format, with no additional resources being gained unless the GM decides to award some. As a result, it feels like my least (mechanically) interesting game, at least in my eyes.
Does the outcome of the randomizer or the characters' abilities change the characters' actions or the reality of the world?
I realise that, once again, I don't really have any good examples for this: most of my games feature quite narrow player agency - you don't really "choose" what occurs in 3 Shining Motes (though you do have control over your interpretation of prompts) so it's up to the player whether events are driven by the world or individuals. The same is true in Summit, with the cards dictating the challenges, and the player deciding what it took to overcome it.
I feel like this might change as I design more multiplayer games, but I find myself leaning towards the perspective of "the characters are capable, but the world doesn't care". Waning Echoes sees each character taking limited actions and getting feedback from them, not from the world (most of the time) but from other characters. Because there's no true failure, there's no way to paint disaster as linked to a character failing - the world is just indifferent.
Do the mechanics invoke ludonarrative harmony, ludonarrative dissonance, a mix, or neither?
I try and integrate mechanics with narrative wherever possible - the card grids in Summit and 3 Shining Motes mimic the landscapes of each game, with Summit's grid growing smaller as the climber climbs higher, and 3 Shining Motes' grid becoming increasingly shrouded as the darkness grows. I've written only a few games I would class as mechanically dense, but all of those have fairly rigid gameplay loops with, once again, The Curse Lingers being my major exception.
Waning Echoes is possibly the example that (while not yet complete) best exemplifies my approach to ludonarrative harmony/dissonance - there are different roles a player can have, all concealed from all other players, and all evoking subtly different experiences of the game. One my have a very limited and puzzle-like set of options, while another might be constantly managing an ever-depleting resource. For one character the game is a power fantasy, while for another it's a tense horror game. I want my mechanics to reflect that wherever possible.
These were great questions and definitely got me thinking about the way I design!
I'd be interested to hear how your own games approach these topics! In addition, here's a few questions I find myself wondering about:
How much agency are players given, and how does it vary depending on the game, or even part of the game?
How frequently are randomisers actually used? What about the situations when they are used requires their use?
What makes a game or game structure feel immersive? Does ludonarrative dissonance break immersion in every case?