mysql 8 - rds - 1022 Can't write; duplicate key in table
That's the wrong way to use DATE_FORMAT.  It is given a DATE or DATETIME and a string providing the 'formatting'.  Example:

mysql&gt; SELECT DATE_FORMAT(NOW(), "%Y-%m-%d"), DATE(NOW());
+--------------------------------+-------------+
| DATE_FORMAT(NOW(), "%Y-%m-%d") | DATE(NOW()) |
+--------------------------------+-------------+
| 2019-01-30                     | 2019-01-30  |
+--------------------------------+-------------+


In your case, it would be something like 

  GROUP BY DATE_FORMAT(performance_stats_date, "%Y-%m-%d")


But this is even simpler:

  GROUP BY DATE(performance_stats_date)


For further discussion, please provide

SHOW VARIABLES LIKE 'char%'
SHOW CREATE TABLE` for each table.
the entire query