I also had a similar problem recently. I can’t say for sure I have absolutely gotten rid of it but I found pre bolusing helped a large part. The lovely folks on this forum made me realise this in the below thread.
Basically, I’m on novorapid so I wait 20 minutes after bolusing before eating. I use 6mmol (108 mg) as my benchmark. If my sugar is higher than this at bolus time, I wait longer before eating. If lower, I my wait is slightly shorter.
I also started playing with my extended bolus. So I would bolus 80% now and the rest 20% over 2 hours. Helps a bit.