Have you already gotten to the part of the ( get_node ) or match pattern ?
Either something is wrong with get_node or its a bug ? I havent done anything with ( get_node_or_null ) yet, so not really sure whats wrong.

@onready var pt1_spr = get_node_or_null("boxCollision/aa1");
@onready var pt2_spr = get_node_or_null("boxCollision/aa2");
@onready var pt3_spr = get_node_or_null("boxCollision/aa3");
@onready var pt4_spr = get_node_or_null("boxCollision/aa4");

var boxPart = pt1_spr ;
match boxPart :
	pt1_spr:
		...(do Something)...
		
	pt2_spr:
		...(do Something)...
		
	pt3_spr:
		...(do Something)...

	pt4_spr:
		...(do Something)...

#--------------------------------------------------------------------
#--------------------------------------------------------------------

Error: Expression in match pattern must be a constant

#--------------------------------------------------------------------
#--------------------------------------------------------------------

It means the match doesn't work on a variable. It needs to be a constant, such as an integer or enum or string (the node name might work).

And the error refers to pt1_spr, pt2_spr, etc., not boxPart. (You didn't specify which line caused the error.)