Multiple superfluous accidentals

I don’t understand why Dorico (randomly, it seems) is putting superfluous accidentals almost everywhere in this file. I have checked that the setting is ‘modernist’, and even changed it another setting and back again, just to see what might happen, but - as you can see - the two bars at where I’ve got to in the file have an impressive surplus of accidentals.

If it’s any help for diagnosis, some of the sections in the file have been copied, pasted and repitched (I use a MIDI keyboard). To repitch I’m following the instructions from the Dorico help pages, namely: select first note, shift-N, L, enter pitches. Is that correct?
Caniad y Gloch - (582 KB)

The first Modernist option is set as follows:

As far as this setting is concerned, none of those accidentals are superfluous.

Your repitching method is indeed correct.

Yes, that’s what I’ve got set, but I still don’t understand why I have surplus accidentals, for example in these last two bars. For instance, in bar 24, shouldn’t the G flat be the last displayed accidental?

The option I screenshotted tells Dorico that each accidental only applies to that single instance of the note. The alternative option (the one that applies in 99% of non-modernist music) is that accidentals apply to that pitch any time until the next barline (or until the accidental is cancelled by another accidental).

I’m most grateful to you. I had that first setting set, and each time I read it I misunderstood it. Thanks so much for pointing this out to me.