Both are correct.
In this case because of the timing of the whistle, either could have been the ruling by the ref, she either believed the puck covered or lost sight of it. Puck out of sight, as you can see, kills the play regardless ( NONSENSE ) of if the puck is still loose. This happens almost every NHL game by the way, so it's a little surprising to see the willful ignorance.
In the end, the ref made the call and clearly declared the play dead before the puck entered the net, then changed her mind when she saw the puck go into the net. That is 100% improper.
And that was the end of the play. It was not in the net when she lost sight of it, so no goal. She got influenced by the players celebrating and seeing the puck end up in the net, which is about the worst thing a ref could do. She has to stand by her call or it's total failure.