For me the analogy falls flat, as the cuban missile crisis is a response to something the US did, and the invasion of Ukraine is a response to something that Ukraine did (and not NATO)

I think I didn't make my main point in the analogy very clear. In case of the Cuban Missile Crisis the USA decided that US security concerns override Cuban sovereignty and security concerns as the missiles were requested as a deterrent against further US interference after the Bay of Pigs Invasion. In case of Russia NATO takes the stance that sovereignty and security concerns of other countries, especially now Ukraine, prevail. This actually used to be different, in the 1990s NATO was initially careful with NATO expansion and created the Partnership for Peace program to make the process more gradual hoping to avoid tensions.

NATO did not court Ukraine, instead Ukraine wishes to be a member, the current invasion to prevent it being so ironically a case in point. Finland is now considering joining as well, as a response to Russias agression.

I would argue that the distinction between NATO and Ukraine is not too important from Putin's point of view. He claims that the West, NATO, and especially the USA are interfering in other countries and shaping their governments. If you believe this, the line between a country wanting to join NATO and NATO wanting a country to join becomes pretty blurry.

It is clear that Russia does not think to invade Finland as well, as it does not consider it to be a part of its old empire, but it does Ukraine.

This has been repeated frequently, but is there actually any good evidence that Putin thinks this way? I haven't looked into this, so I am only vaguely aware of two points. When Putin became president in 2000, there was a controversy about the national anthem of Russia and Putin decided to use the USSR one with new lyrics. His explanation was that there was already enough change and considered it as a small token of stability.

Then I am aware that he called the fall of the Soviet Union a tragedy, but I don't know about the context. On the other hand in 2000 he said roughly this.

You can not take anything back. You can neither get your youth back nor the years that have passed. Even more, if we try to return to the past, we will certainly destroy everything permanently. But we can do something so that people are not only not worse off but better off than in the past.

This isn't made any easier by the fact that we are talking about at least two decades and viewpoints change. But I would really be interested in evidence one way or the other and how this might have changed over time.

EDIT: The points about the national anthem and going back in time I got from the documentary Putin's Witness which was recently uploaded by Ukrainians in two parts [1][2] with English subtitles. I was quoting from the scene at 18:05 in part two. The subtitles in those videos may be more faithful translations as I just roughly translated it from the German version of the documentary.

I would also like to highlight what follows 22:50 in part one, it's about the apartment bombings and Putin visiting the scene. I can hardly imagine a more stark contrast between his words then and his actions now. And the whole things is of course a big controversy in itself, were those terrorist attacks or did Russian forces blow up Russian apartment buildings in order to unite people behind Putin and legitimize military interventions? If it was staged, did Putin know or was even involved?

[1] https://www.youtube.com/watch?v=Hc8-EaP5GM4

[2] https://www.youtube.com/watch?v=NtGqcYH4hUk