*Just curious* I erroneously used hook add_action() instead of add_filter() and there was no error and the result was correct. Why is that?

add_action() uses add_filter() behind the hood.

function add_action( $hook_name, $callback, $priority = 10, $accepted_args = 1 ) {
    return add_filter( $hook_name, $callback, $priority, $accepted_args );
}

Source: https://developer.wordpress.org/reference/functions/add_action/

So basically it doesn’t matter if you use add_filter or add_action.
But it doesn’t mean you should, using the appropriate function for a event will make your code easier to follow and understand, if you always use add_filter or add_action for every single event it can create a lot of confusion.