You did not specify the value for filename. Either you omitted in your post or that is the problem.
I use a csv file in the project. And although there's a red cross, this file is readable.
You could however put the file in an own directory (i.e. res://data) and add a .gdignore file to that.
...but this would mean that the file will not be shown in the godot file manager and I doubt that it'll be included if you export the project. So I'd vote against using .gdignore.
Here's a part of a working code example:
var groupname=""
var file = File.new()
file.open("res://resources/data/llangollen_aqueduct_trees.csv", file.READ)
while !file.eof_reached():
var csv = file.get_csv_line ()
if csv.size()>=7:
if csv[2] != groupname:
groupname=csv[2]
file.close()