I can see the host but when i click facts got some error

Problem:
I created a puppet fact as a json file and put into /etc/puppetlabs/facter/facts.d/ directory of each server. The content of the json file is as below:

{
  "myfactname": {
       "server"             : "database",
       "owner"              : [ "xgroup", "ygroup" ],
       "install_date"       : "10012018"
  }
}

When I run “facter -p myfactname”, I can see the server, owner, install_date related data in the output, there is no problem here.

My purpose is putting a filter to categorize my servers on the foreman dashboard for example the people in the database organization will be able to see just the db hosts.I created a user and a role for the organization and I put a limitation for view_hosts item with filter tab (facts.myfactname::xxx). And When I login with the user I just see the related hosts, it is working fine but when I click onto the host and the fact button, I got the following error:

Oops, we're sorry but something went wrong PG::UndefinedTable: ERROR: missing FROM-clause entry for table "fact_names_2" LINE 1: ...s.name = 'hostname.domain.com')) AND ((fact_names... ^ : SELECT "fact_values".* FROM "fact_values" INNER JOIN "hosts" ON "hosts"."id" = "fact_values"."host_id" INNER JOIN "fact_names" ON "fact_names"."id" = "fact_values"."fact_name_id" WHERE ((hosts.name = 'hostname.domain.com')) AND ((fact_names_2.name = 'myfactname::owner' AND fact_values_2.value ILIKE '%%dbgrp%%')) AND (fact_names.name <> '_timestamp') AND "fact_names"."ancestry" IS NULL ORDER BY "fact_values"."value" ASC NULLS FIRST LIMIT $1 OFFSET $2

Expected outcome:
I expected to see the facts of the host.

Foreman and Proxy versions:
1.20.1

Foreman and Proxy plugin versions:

Other relevant data:
[e.g. logs from Foreman and/or the Proxy, modified templates, commands issued, etc]
(for logs, surround with three back-ticks to get proper formatting, e.g.)

logs

This sounds like a bug. Can you please file it on our bug tracker including the full stack trace from production.log?