NATO was defending itself from Kosovo? And Libya?
NATO got involved in Kosovo because there was an ongoing genocide and all attempts at diplomacy had failed, based on the thinking that falling to intervene would cause the conflict to spread into NATO states. It was NATO's first foray into unilateral peacemaking and NATO learned it's lesson which why is why it hasn't engaged in that since. I don't think anyone is trying to claim NATO is perfect, but it's been around since 1949 and only made this mistake once. That's not a bad record.
The UN's Charter spells out the rights and powers in the UNSC to authorize force for peacemaking operations. The UNSC, which Russia is part of and has veto powers in, passed resolution 1973 with 10 votes for and none opposed. This authorized international militaires to establish and enforce a no-fly zone and to take any military actions to preserve civilian life. Multiple NATO members immediately got involved under the auspices of the UN, until the UN asked the NAC to take over and the NAC met and agreed to.
The NATO Charter and international law allow NATO to engage in non-defensive operations under very strict circumstances. While those weren't met in Kosovo, they were in Libya. No one, not even Russia, had a problem with NATO mission in Libya, nor does that violate NATO's stance as a defensive force.
NATO took over as a means of improving command and control of a mission that was primarily being carried out by member states acting under their own auspices. It became NATO led out of necessity, it was not a NATO-initiated action, and it was done with full authorization and under the direction of the UNSC. This interaction with the UN was a direct result of lessons learned from Kosovo.
NATO is indeed a defensive alliance that acted offensively unilaterally once in error, and otherwise may act on the direction of the UNSC in cases of humanitarian crisis. Acting under the auspices of the UNSC, given the ability of opposing regional powers spread across the globe to veto any resolution as permanent members of the UNSC, is a reasonable way to establish the necessity and benefit of offensive operations to preserve human life and does not violate the integrity of being a defensive pact. If it did, that would mean no defensive organization could provide medical aid or assist in evacuations for natural disasters without being called out for "non-defensive operations." It's a ridiculous position to argue Libya proves NATO is not a purely defensive alliance.