problem with using tweens

Godot Version

Godot v4.2.2

Question

So I am trying to make a crouch mechanic using a animation tree. I have created the tween in my code as you will see below. Before I added the blend tree node crouching worked but now it doesn’t work and gives this error:

What am I doing wrong?

Code

extends CharacterBody3D


@export var speed = 8.0
@export var crouchSpeed = 4.0
@export var accel= 16.0
@export var jumpVelocity = 8.0
@export var sensitivity = 0.2
@export var minAngle = -86
@export var maxAngle = 89
@export var animation_tree: AnimationTree


@onready var head = $Head
@onready var collisionShape = $body_collision
@onready var topCollision = $TopCast


var gravity = ProjectSettings.get_setting("physics/3d/default_gravity")
var lookRotation : Vector2
var crouched = false
var crouched_blocked = false


func _ready():
	Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)

func _physics_process(delta):
	var moveSpeed = speed
	# Add the gravity.
	if not is_on_floor():
		velocity.y -= gravity * delta
	else:
		if Input.is_action_just_pressed("jump"):
			velocity.y = jumpVelocity

	# Get the input direction and handle the movement/deceleration.
	# As good practice, you should replace UI actions with custom gameplay actions.
	var input_dir = Input.get_vector("left", "right", "forward", "backward")
	var direction = (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
	if direction:
		velocity.x = lerp(velocity.x, direction.x * moveSpeed, accel * delta)
		velocity.z = lerp(velocity.z, direction.z * moveSpeed, accel * delta)
	else:
		velocity.x = lerp(velocity.x, 0.0, accel * delta)
		velocity.z = lerp(velocity.z, 0.0, accel * delta)
		
		
	move_and_slide()
	
	head.rotation_degrees.x = lookRotation.x
	rotation_degrees.y = lookRotation.y
	
func _input(event):
	if event is InputEventMouseMotion:
		lookRotation.y -= (event.relative.x * sensitivity)
		lookRotation.x -= (event.relative.y * sensitivity)
		lookRotation.x = clamp(lookRotation.x, minAngle, maxAngle)
	
	if event.is_action_pressed("crouch"):
		Crouch()
	if event.is_action_released("crouch"):
		Crouch()
		
func Crouch():

	var Blend = 0.0
	if crouched:
		Blend = 0.0
	else:
		if is_on_floor():
			Blend = -1.0
		else:
			Blend = 1.0
	var blend_tween = get_tree().create_tween()
	blend_tween.tween_property(animation_tree, "parameters/Crouch_Blend/blend_amount", Blend, 0.2)

	crouched = !crouched