So how close was the car to OP in that case and how much closer would the car have passed if OP was further left?
OP is positioned where he should be. Any cycle training will teach that position rather than riding in the gutter.
https://www.cyclinguk.org/article/road-positioning-cycling-explained
Not aimed at you in particular, acme, more of a general observation: many people are in favour of mandatory cycle training but seem blissfully unaware of what that would include, i.e. teaching cyclists to ride further out from the gutter. I think most people who only drive would think the courses would teach the opposite.
I think you have to be far more aware of your situation before you decide on riding assertively or passively.. I treat every road differently in an aim to reduce the risk as far as I can so mix things up accordingly, sometimes assert my position, sometimes be passive to not be a deliberate slow moving hazard..
In this case I think the OP is not in the right position.
If we look at the cyclist in front and the offending car (who is just in his lane at this point, his tyres just touching the white markers)
The cyclist is a good few cm's out from the double yellows and so not what I would call 'in the gutter' but approaching a practical 'secondary' position, one where they have room to move around whilst still allowing cars to pass easily without having to really go out of their lane, in this case I'd say around 1M+ enough to be perfectly 'safe'.
Then you have the OP, he's actually created the very situation where "Riding in or near the gutter increases the chances of drivers buzzing past you with inches to spare" except he's done this from the middle of the lane.. he's left just the wrong amount of room that two cars can fit between him and the central reservation.. This is a dual carriageway with two lanes at this point.
I can honestly say I'd be adopting the same position the cyclist in front is, it's the safest position..
Also anecdotally from my own commuting on a bike, I've noticed a contingent (not necessarily the OP) of cyclists that need camera's as they keep running in to problems that always blame everyone else and haven't asked the obvious questions of "what can I do to minimise risk? or perhaps is my road craft or hazard perception not very good?"..