HHH-7928 - Regression caused by HHH-6361
(cherry picked from commit 991342f2c269973378cd03f79959dee08d3c90ff)