I have fixed this by doing the following:
select
ts_rank(to_tsvector(replace('a_a_do_ug_read_retreqmon_ptam','_',' ')),plainto_tsquery(replace('a_a_do_ug_read_retrmso.com_ptam','_',' ')))
so I have found a solution, just wondering what the earlier error means/what causes it. I could not find any references to that error in documentation or in help searches.