They knew they were a NUCLEAR buffer zone but not “a buffer zone” in general.
But there was nothing stated that they couldn’t join NATO or anything else that an independent nation could join.
Nuclear disarmament is formed by international agreements but statehood of Ukraine means some measure of autonomy similar to that of any other nation.