That's odd. Click are usually associated to audio artefact, which could indeed be alleviated by mean of crossfades, or wave redraw or using the snap to zero crossing
But in your case, according to the posted pictures, it involves MIDI region. I'd venture that might be due to CPU overload
BTW, is there any other tracks in your project (that could be involved in your issue)?
Have you tried adjusting (increasing) the I/O buffers in your audio prefs?
Otherwise, if the project involves only those MIDI regions, one could bounce-in-place
the track, use fades in / out at beginning & end respectively and then playback only that track (muting the problematic MIDI - other track source-s).
Admittedly that represents a convoluted workaround, but worth trying...
LogicPro 10.7.1, MainStage 3.5.4
MBPro 17", Core2Duo, 8G, OSX 10.12.6
MacPro, Xeon 6Cores, 64GB, OSX 10.15.7
ULN8, MOTU MIDI TP-AV, C4, MCU Pro, KorgNano, Novation SLMkII
AAS, NI, Celemony, Spectrasonics, Korg, Arturia, etc...
PC, iPadPro 5th gen 12.9”(Duet D., V-Control & LogicRemote), AtariST(Notator SL), Several vintage gear