Most people remember Jay-Z’s hit “Big Pimpin’ “,but most seem to forget that there was a lawsuit that followed. It was because of the alleged unauthorized use of music from the original here. However, as late as 2018, a court ruling finally dropped the copyright infringement case against Jay-Z and Timbaland (who actually produced the track that Jay-Z and UGK rapped on). Simply put, the court ruled that the nephew of the original Egyptian composer, Baligh Hamdi, basically had no right to sue under Egyptian copyright law.
So it wasn’t based on whether or not the sample was taken. It was based on whether or not there was a right to sue over the sample.