What I've seen is, when I do a slow inlap or outlap (to create some room) like you, the game constantly creates a yellow flag on that part of the circuit where I am (probably because I'm driving this slow)
And then indeed, the AI doesn't pass me, just until I speed up a little bit and the yellow flag disappears