I am creating static cursors in memory with the same method and it works in all cases, but I use LR_DEFAULTCOLOR|LR_DEFAULTSIZE as the last argument. Also, it depend on what are the data are you actually sending to the function. It should not be the actual .cur file, but only one of the images preceded by hotspot coordinates. So, if you can pict the desired image from the images in the .cur file, you can pass it to the function.
As for animated cursors, I have not find any function that can create them in memory and I save them to temp folder and create cursor from the saved file.