Check Validity on widget always fail

Hello, I am trying to check if a widget already exist on on viewport by checking the widget reference validity, following this Thread, it will be invalid for the first iteration and should have succeed on the second iteration after it got set. But for my case it always return is not valid. Any idea why?