the Azerbaijan Soviet Socialist Republic (SSR) was not a sovereign nation but a province of the Union of Soviet Socialist Republics (USSR), just like Chechnya is not sovereign today as a province of Russia, no matter what it is called.
Therefore when the Soviet Union fell in 1991, the new nation Azerbaijan which formed had no historical sovereign rights to Artsakh related to 1921 (when Stalin arbitrarily changed the internal boundaries of the USSR).
At the fall of the Soviet Union it was a matter for people of the new nations to determine their future. That is precisely what the people of the Ngorono-Karabakh Republic did – voting for independence as they were overwhelmingly ethnically Armenian (entirely understandable after the 1915-1923 Armenian genocide when Turks killed two-thirds of Armenians and stole ancient Armenian property in what is today Turkey ). Note: Azeris are Turkic people. In summary, the people of Ngorono-Karabakh were not voting to break away from Azerbaijan at all, as Azerbaijan was just a province until 1991, with no automatic legal sovereign rights related to 1921.