In your function, param is a keyword argument and start_idx/end_idx are positional arguments. Basically, a keyword argument is just a positional argument with a default value. If you understand the error message, you can fix it by putting positional arguments before keyword arguments. Make the following change and it will solve the problem.
X, Y, metavisits_list = fetch_data_from_npy_file(start_idx, end_idx, param='test')