Error Invalid set index 'blend_position' (on base: 'null instance') with value of type 'int' while using blendspace1d

Godot Version 4.2.2

Im trying to create a menu for my game and while running the code I get this error

Invalid set index ‘blend_position’ (on base: ‘null instance’) with value of type ‘int’
Honestly im new in godot and I’ve trying to search how to fix it but I have no clue, I’ve created the animations in the animationtree, im using the animation node blendspace1d, does anyone knows what is missing? or how can it be fixed

extends Control

@onready var scroller : ScrollContainer = $VBoxContainer/ScrollContainer
@onready var animation_tree : AnimationTree = $AnimationTree

var is_scrolling : bool = false

func _ready() → void:
#yield(get_tree(), “idle_frame”)
await get_tree().process_frame
scroller.scroll_horizontal = size.x * 2

func _on_scroll_container_scroll_started() → void:
is_scrolling = true

func _on_scroll_container_scroll_ended() → void:
is_scrolling = false

func _process(delta: float) → void:

var scroll = scroller.scroll_horizontal/size.x  

if is_scrolling: 
	animation_tree['blend_position'] = scroll
elif abs(int(round(scroll))-scroll) > 0.1:
	animation_tree['blend_position'] = lerp(animation_tree['blend_position'],int(round(scroll)),0.1)
	scroller.scroll_horizontal = lerp(scroller.scroll_horizontal,size.x * int(round(scroll)), 0.2)
	animation_tree['blend_position'] = int(round(scroll))
	scroller.scroll_horizontal = size.x * int(round(scroll))

Are you sure the animation tree is at $AnimationTree? It seem to think that variable is null. Could you show your scene tree?