fixes #15026 [backport] (#15040)
fixes #15026 [backport] (#15040)

no test case since only a special case was affected and the special case got removed
dom96/Nim,dom96/Nim,dom96/Nim,dom96/Nim,dom96/Nim,dom96/Nim,dom96/Nim