Why the Path is different with the one coded in rest

No it shouldn’t.

The first parameter is called namespace. It’s like the scope for your functions such as this:

function my_function(){
    $data = 0;
}

You can only use $data inside that function. Same goes with the REST endpoints. The path /test/ will be available only under its specific namespace.

You should choose a unique namespace for your plugin or theme, and build different paths for different endpoints.

The second argument is the path. It’s like branches of a tree. Imagine a tree as a namespace, and its branches as paths. You can climb the tree, and then choose a branch to harvest the fruits.

However, both of these are under the scope of rest route, has a base of /wp-json/ if you have pretty permalinks enabled, or /?rest_route= if you are using plain permalinks.

Check the code reference about register_rest_route() for more details.