I have no problem using the XML editor of Inkscape 1.2, since it's well-explained, but when I rename the pattern, the image I've imported goes blank, and also the list of patterns goes blank
You're not renaming the pattern, you're changing which pattern is referenced by the object, meaning it now tries to use an undefined pattern.
You have to both change the pattern
id-attribute inside the
<defs>-tag and fix the reference on the object.
It's probably faster and easier to use the 'Edit → Find/Replace...' dialog. Enter the pattern name without the leading '#', set it to 'Search in Properties' and make sure 'ID' and 'Attribute value' are checked in the options.