They are pretty much unrelated.
So first of all the Cuban missile crisis happened (~60 years ago) in the context of the cold war. Which at least superficially was an ideological and military conflict of Western capitalism vs "Communism" where Western capitalism mostly represented by the U.S. and it's allies fought to contain the expansion and encroachment of Soviet "communism". Or if you want to frame it the other way around the Soviet Union aided third world countries in their struggle against Western colonialism. Or if you're more of a cynic. 1 power block rivaled a different power block for global imperialist influence.
But no matter how you frame it there was a climate of hostility, battles were already fought, though by proxy as both sides began testing and stockpiling nukes that made direct confrontations and full scale assaults on the respective enemy unlikely or very costly.
So the Cuban missile crisis was significant as it's one of the closest points these two cold warring factions came to direct assaults and open nuclear war.
Now the U.S. had positions nukes in Italy and Turkey a year prior and when Cuba was asking the Soviets for help with the ongoing U.S. attempts to invade them (and apparently because the Soviets wanted to secure influence over Cuba and not have the rivaling "communist" system in China take that role), they send short and mid ranged nukes to Cuba.
Combined with apparently a fear of the U.S. of not having enough capable weapons it got the U.S. president sweating and the situation came close to an escalation of actual nuclear war. Luckily for literally everyone, that didn't happen, the the Soviets retreated, the U.S. vowed not to invade Cuba and apparently secretly also dismantled the rocketry in at least Turkey, plus a direct line between the leaders was established to avoid such confrontations in the future.
Now back in our timeline, the cold war has ended in the 1990s. The ideological pretense of the USSR was dropped and the USSR itself ceased to exist. So rather than a union of socialist soviet republics, it's just one "republic" (Russia) which doesn't even claim to be socialist or soviet anymore.
So unlike the cold war where you already have hostilities and where you can argue that the U.S. made the first move in terms of actually threatening Russia, with nuclear missiles at its border. In this case you have no or very little prior conflict to that to begin with.
Seriously I cannot stretch that enough, but the reason why every escalation mattered during the cold war was because you had 2 global empires basically considering each other as a mortal threat to their existence also being on the edge of having that one situation that breaks the camels back and make it go from a cold war to a literally temperatures-on-the-sun-levels hot war... So every new weapon or battle ground could be the beginning of the end. Which even includes defensive systems and anything that could tilt the fragile balance of power one way or another and make nuclear assault a feasible option.
However, again, we're no longer in that context anymore. The 2 systems with their narrative of mutually incompatible ideologies and their fears of annihilation at the hand of the other ceased to be present.
Like there were NATO-Russia cooperations, there were several institutions to move on together, Russia was part of the G8 and whatnot, Russia got the nukes of the former soviet republics in exchange for guarantees of their sovereignty (including Ukraine, who at some point was the 3rd largest nuclear power in the world), and so on. The thing is having that nukes with a stable Russia was seen as more secure than having them fracture over a lot of smaller countries who might eventually use them at some point.
Now in hindsight Russia has apparently never ditched the mindset of the cold war and has for quite some time pursued to extend it's influence via military means: https://en.wikipedia.org/wiki/List_of_wars_involving_Russia#Russian_Federation_(1991%E2%80%93present)
But even now I'm not sure the West fully acknowledges to what extend Russia seems to see this as a cold war and not as a local conflict.
Like Russia's propaganda seems to play that up to the point of mortal threat, of the West encroaching upon Russia, preparing for an assault and whatnot. When in reality... the West more or less lost interest in Russia to begin with. Like there's no reason and no intent to nuke Russia off the map and there's very little to gain from it, likewise Russia attempting that with any NATO country can only result in tremendous loses. So for the longest time Russia wasn't really on most people's mind anymore and contrary to the Russian narrative for the last decades there was pretty few hostility towards Russia and an ever decreasing willingness to fight a total nuclear annihilation war or a war at all after the disasters that have been Afghanistan and Iraq.
So to a large extend Russia has to build it's own enemy, because quite frankly the West for a long time has not been up for that. Like even when Russia broke it's treaties with Ukraine and got involved in their politics and annexed part of that country, the West was... ok, diplomacy, sanctions, peace talks and were eventually already preparing to get Russia back at the table.
So unlike the Cuban missile crisis where the U.S. did firmly acknowledge being at war with the USSR and where the U.S. themselves have taken aggressive steps towards Russia and where an actual U.S. assault was not even that far fetched or at least where a global nuclear conflict was in the realm of possibilities.
In this case the U.S. (at least the population) by and large probably isn't even aware that they are at war with Russia and even the leadership didn't seem to have been taking this serious either. And you really have to stretch and twist the facts to construct a narrative in which the U.S. made the first move in this. And even if you find such a fact, that is not comparable with bringing nuclear missile in shooting range and with a real threat of them being launched while having no defense system against that beyond nuclear retaliation.
It's only if you see that in the context of a cold war that you could pump up any talks about potentially joining an alliance years into the future to the point where this is a mortal danger.
So what is much more realistic is that Putin is simply playing plain old imperialistic power politics, where he has little to offer to his neighbors and can't pursue them with soft power and so he uses hard power to coerce them into his sphere of influence. And in that regard a NATO membership of these countries hurts his aspirations as any of those with one could just whisper gently "article 5" and he'd have a problem.
But that has nothing to do with NATO planning to attack Russia or with Russian security interests.
On the contrary, it's not even that NATO is pursuing countries to join the alliance, pretty much the opposite of that. Often enough the admission is vetoed or delayed because those countries lack the military, economic or even the political standards and stability to be an asset and not a burden for the alliance. So most often it's not NATO annexing countries (those countries need to apply to NATO and be affirmed by NATO and can leave NATO whenever they want to anyway...), but rather countries within the Russian sphere of influence or whatever they like to be that, who fear for their very existence (and after 2014 and 2022 might have good reason to), that seek admission to NATO as additional security against tyrannic imperialistic claims of a Russian hegemony.
But that's not the kind of narrative that gets you any sympathy for pursuing a war, neither internally nor internationally and so Putin tries with anything but that.
However the West is in a very tricky situation now, as Putin seems to have given up on any pretense of international law, not even trying to disguise it as something else or as a one off thing, he's essentially presenting himself as unstable megalomaniac. And as the 20th century has shown with Hitler, just giving a megalomaniac what he wants to appease him hasn't worked particularly well and the fact that after basically getting Crimea without much resistance has not stopped him from pursuing Ukraine further is not a good sign in that regard. So there's little that makes that seem issue specific or that indicates Putin has any plan where to stop and call it a day and settle for a new permanent peace.
On the contrary he seems to be in full cold war mode and not attempting to step on the breaks any time soon.
So on the one hand the West has to react to that as it a dangerous escalation away from any framework of peace and stability and closer to a traditional imperialist war driven order, except this time with the threat of nuclear annihilation. On the other hand Russia is a thermonuclear power that you don't want to seek direct conflict with.
The problem is that within Russian narrative any move that the west is making that is not total submission and letting Russia expand, is framed as escalation and aggression and Russia draws a lot o offensive red lines. Which is dangerous. Like the West is probably justified in assuming that Russia isn't going to set the world on fire over a regional conflict and seek WWIII if they are more than busy fighting a regional war with a much smaller neighbor. But at the same time Putin has to defend at home that he's drawing all these red lines and then isn't committing on them.
So ultimately it's very hard to tell whether this is FOR PUTIN, close to the Cuban missile crisis where he actually risks to blow shit up to get things his way or where he just threatens that with the assumption that the West isn't willing to blow things up either with respect to a regional conflict and where thus threatening with nukes, WWIII and global conflict scares them out of any further intervention.
Either way (TL;DR), the Cuban missile crisis actually had real escalations and threats to the mortal existence of both major players and so there was a clear out that is mutual deescalation that benefited both sides. In this case, this presents itself as a very one sided escalation without a mortal threat for either side (yet) and the search for an exit strategy that is not basically giving in to the violent demands of a megalomaniac and thus validating that strategy and encouraging more of it and that is not a humiliation of a nuclear superpower on the global stage (which is also not great either), is not that easy. So how serious that actually is or has been can probably only be told in hindsight...