Can you show some sample data from the RowCounts table? Also - what is the collation for the database and specifically for each table?
There are some issues with your table design. Objects are defined with the data type sysname or nvarchar(128) and should be consistently set across all tables. Having different data types will force an implicit conversion - which can and will affect performance.
The RowCounts table does not have a defined relationship with the FragmentedIndexes table. You cannot relate solely on the TableName as you can have the same table in many databases across many different servers.
Since you are identifying indexes separately in FragmentedIndexes - you will get multiple rows from RowCounts for each table. This will require additional logic to remove the duplicates - making the queries harder to work with as well as take much longer to execute than necessary.