I had this problem while developing a custom WordPress widget for my client, it displays random testimonials with thumbnail,video and star ratings.
Below is a part of my code on the custom widget
And it only displays the latest testimonial, but compared to my previous developed websites, with same php code it randomly displays posts.
I found a solution from this site
The code above is removing all the filters before running the query.