Sometimes 4K and 1080p movies are marked as duplicates and sometimes they are not

Assuming your library points to Movies, Plex does not support such subfolders. You need to eliminate the 007 James Bond (series 1962-2015) folder.

All the “extra stuff” in the file name should be in square brackets, so Plex will ignore it. As is, Plex will try to use it when matching the movie name, which means the probability of success is much lower. See this post for detailed info on how Plex matches things.

See also the Your Media documentation for how Plex wants media structured and named.

Try the following:

.../Movies  <-- Movie library points here
     /Casino Royale (2006)
       /Casino Royale (2006) [1080p yada yada].mkv
       /Casino Royale (2006) [2160p yada yada].mkv

or

.../Movies  <-- Movie library points here
     /Casino Royale (2006) [1080p]
       /Casino Royale (2006) [1080p yada yada].mkv
     /Casino Royale (2006) [2160p]
       /Casino Royale (2006) [2160p yada yada].mkv

Note: As mentioned in the documentation, not all apps are capable of selecting which version of a movie to play. Many users keep 4K/UHD media in a separate library to prevent inadvertent transcoding of 4K material (ex: Movies and Movies 4K). This also helps when sharing libraries with remote users who may not have 4K capable systems or the bandwidth to stream 4K media. If you don’t share the 4K library with them, then you never have to train them about “Play Version” to prevent transcoding and associated load on your system.

Note 2: If you use external subtitles, the subtitle name must match the movie name exactly, including what is in the square brackets (with obvious exception for language and extension).
Example:

/Casino Royale (2006) [1080 yada yada].mkv
/Casino Royale (2006) [1080 yada yada].eng.srt

https://support.plex.tv/articles/categories/your-media/