Problem exporting to Photoshop in a macro

I have a macro that sends a bitmap to Photoshop from CorelDraw, but in the new version of Corel it does not work: Corel freezes or crashes after this instruction:

Set ex = d.ExportBitmap(p, cdrPSD, cdrSelection, s.Bitmap.Mode, s.Bitmap.SizeWidth, _
s.Bitmap.SizeHeight, s.Bitmap.ResolutionX, s.Bitmap.ResolutionY, cdrNoAntiAliasing, , True, , False, cdrCompressionRLE_LW)
ex.Finish 

At the same time, if you select cdrTIFF as a filter, then everything works fine. In versions up to and including 2021, everything works great with cdrPSD. I changed cdrCompressionRLE_LW to other types of compression and tried without compression, the result is the same. Moreover, after editing the macro, it works once or twice, and then it doesn’t work again.

any ideas?

PS standard export works well