You need technique, but you also need the right product for the job. If you use a filler that shrinks, then you will need to apply several coats. If it shrinks too much, it may just fall out of the knothole. If it is not weatherproof, it may soften and swell up, even under a paint job. Why do most wood fillers shrink? Most of them harden by having their water or solvent evaporate. That means there is less mass as it gets harder and it collapses in on itself. Some fillers set hard first, then the water evaporates, hence they don't shrink and they don't swell. Use an exterior wood filler on that deck railing. Now a couple of tips to make a good filler stick even better. Scrape up the smooth knothole sides, and gouge a bit so that the filler can get a mechanical hold on the wood. You could even add nails or screws into the bottom of the knothole so that the filler will go around and grab onto the heads. Good fillers can be sanded or planed and, with pilot holes, nailed or screwed into. You can add a little bit of water-based stain before filling and finish off the color match after it is dry.