Two nuts, two completely different problems
Walnuts and hazelnuts get lumped in with "tree nuts" and roasted on almond timings, which is roughly how both of them get ruined. They fail in opposite directions. A walnut is fragile and goes bitter and stale faster than anything else on the shelf. A hazelnut is robust enough, but its skin is a bitter papery layer that will not soften, and the entire roast is organised around getting it off.
Walnuts
The most fragile common nut
Walnuts carry a great deal of oil, and that oil is the least stable of the common nuts. It oxidises faster, which shows up in two places: they turn painty and bitter in storage sooner than any other nut you will handle, and they take heat damage sooner during the roast itself. Both consequences point the same way. Roast light, roast short, and use them quickly.
Colour will lie to you
A walnut half is already brown before it goes anywhere near heat, and its surface is irregular and shadowed. You cannot judge a walnut roast by looking at the outside the way you can with an almond, and people who try consistently over-roast them.
Judge instead by aroma and by cross-section. The smell turns sweet and properly nutty shortly before they are ready and sharpens rapidly afterwards. Break one open: the meat inside should have moved from white to a light cream or pale gold. If the interior is going tan you have gone too far.
The skin is tannic and it does not come off
Most of a walnut's astringency lives in the papery skin in the folds of the meat, and unlike a hazelnut's it will not rub off — the geometry is against you. The important consequence is that deepening the roast does not burn that bitterness away, it amplifies it. A dark walnut is an astringent walnut. There is no dark roast worth having here.
Taste one raw before you commit
This is the most useful habit with walnuts specifically. Because they stale fast, a proportion of the walnuts on sale are already partway to painty before you buy them, and roasting will not correct that — heat concentrates it and makes it obvious. If the raw nut already tastes bitter or of old paint, do not spend a roast on it. And once you have roasted a batch, that clock speeds up considerably: see storing roasted nuts and rancidity.
Halves, not pieces
Broken walnut pieces have far more exposed surface for their mass. They colour faster, take oxygen faster and go stale faster. Roast halves where you have the choice, and break them afterwards.