The role of NATO was to set up a defense alliance for its members. Ukraine is not a member and thus NATO has no obligation towards Ukraine. NATO is not failing to do what it was setup to do.
The failure here is the UN and the failure of the international community to get rid of nuclear weapons. It is the existence of nuclear weapons which makes this tragedy possible. Sadly many have argued nuclear weapons prevent war. This current war demonstrates just how naive that position is.
I would like to see a world where nuclear weapons are banned and any nation seeking them gets invaded by UN led military force.