ListItem.Trailer Script, odd behaviour

Hello,

I’m trying to make a script that can work with a keymap – basically I want it to play a video trailer on key press. I have everything seemingly working, except for if there’s a local trailer in the drive, it seems to throw different behaviours and I can’t track down what’s the cause. Here’s the scenario where I have trouble getting a local trailer (as opposed to a youtube trailer) to play back, and the results. For development purposes, I am also using local nfo files for the movies to try to isolate the cause.

Movies are all sorted like this:

Code:
Movie (YYYY)/Movie (YYYY).mp4
Movie (YYYY)/Movie (YYYY)-trailer.mp4
Movie (YYYY)/Movie (YYYY).nfo

Info is loaded to KODI and data from the internet is not scanned.

if I press `i` -> `trailer` from video view, then the trailer always plays back.

however, my script, in its simplest form gets the item Trailer and tries to play it, but I get three different results.

Code:
xbmc.Player().play(xbmc.getInfoLabel('ListItem.Trailer'))

This is essentially the code ^^

Here’s 3 snippets of nfo files for movies, with the 3 different results when running my Script:

Code:
<!-- "trailer not found" (message from script debug) -->
<trailers>
  <trailer name="YouTube: Official Trailer" quality="Standard">plugin://plugin.video.youtube/?action=play_video&amp;videoid=AdAYLVY0KrY</trailer>
</trailers>
<trailer>plugin://plugin.video.youtube/?action=play_video&amp;videoid=AdAYLVY0KrY</trailer>

<!-- "Addon Required: YouTube" (message from kodi) -->
<trailers>
  <trailer name="YouTube: Trailer 1" quality="Standard">plugin://plugin.video.youtube/?action=play_video&amp;videoid=gXdru_rLBfw</trailer>
</trailers>
<trailer>plugin://plugin.video.youtube/?action=play_video&amp;videoid=gXdru_rLBfw</trailer>

<!-- plays local trailer -->
<trailers>
  <trailer name="YouTube: Trailer" quality="Standard">plugin://plugin.video.youtube/?action=play_video&amp;videoid=ErjP5xMTc8I</trailer>
</trailers>
<trailer>plugin://plugin.video.youtube/?action=play_video&amp;videoid=ErjP5xMTc8I</trailer>

I cannot figure out why these are all different when the nfo appears to be the same for each movie. Please help.