Midi instrument section ‘out of tune’

Hi, having used Cubase 9.5 Artist for about a year I felt comfortable with how things were working and what I was doing, except until recently.
Using Halion, I recorded multiple separate sections on the same ‘track’ using Pich Shift on my midi keyboard for a steel guitar sound. The bad news is one of the sections when played back from some way before it comes in and including a previously recorded section, it plays back out of tune. Play into the ‘out of tune’ section just before it starts and it’s fine and in tune.

I’ve done stuff like re set sounds, re-recorded that ‘out of tune’ section several times without luck and in case it was due to the section before causing the problem regarding the pitch shift, re-recorded that too. Nothing helps.

Any advice would be really appreciated as I can’t move forward on this song until this san be sorted

Nick