Netclass change can not be save

I wrote a very simple plugin, for example, to set the GND net to “love”(netclass). The code runs successfully, and the PCB interface shows that the net class has been modified. However, once saved, the net class reverts to its original state. i ask AI for help, i try what they said, but it still go back to old netclass

import pcbnew
import wx

class SimplePlugin(pcbnew.ActionPlugin):
def defaults(self):
self.name = “first”
self.category = “debug”
self.description = “show welcome”
self.show_toolbar_button = True
self.icon_file_name = “”

def Run(self):
    board = pcbnew.GetBoard()
    if board:
        net = board.FindNet("GND")          
        net.SetNetClass(board.GetNetClasses()["love"])
        wx.MessageBox(f"hello,KiCad {pcbnew.GetBuildVersion()}!", "success")

register plugin

SimplePlugin().register()