Hello Thomas, welcome to the forum
When you play with MG, you don’t notice what are called stuck notes, ghost notes, etc., which are triggered by the inaccuracy of the guitar playing (harmonics, resonances…) but which are recognised by the software in a very precise but indiscriminate way: it detects indifferently the faults and the good frequencies to be kept.
That’s why when you look at the MIDI recording, you see these defects displayed in the grid but you don’t necessarily hear them when you listen.
That’s where you see the quality and precision of the guitar playing that has to avoid these defects. Personally, when I record, I end up with a lot of these unwanted notes that I have to delete manually afterwards because I’m not a very precise guitarist! If you are an excellent performer of a classical piece of music, I think there will be few or no unwanted notes.
For more details on how to reduce these defects, you can search the forum. An example among many others:
Precision and Accuracy problems for MG2 on Lagic Pro x
You can also find more tips in the forum on the proper use of the guitar: type of pickup, gain and tone settings, use of a string dampener, etc.
On the other hand, concerning the treatment of these unwanted notes, I don’t use Logic pro but there is certainly a tool to selectively filter MIDI events and automatically remove notes of a given length as I do in Reaper.