That's the strange thing, it's not a stack, just two images, nothing happens, this is the result after running the installed script with only these two images selected beforehand:

Its probably the uppercase file extensions? Try this revision. I had to initially fix ".jpg" vs ".jpeg". Obnviously this script could be modified to work with any type of file as needed.
#target bridge
if(BridgeTalk.appName == 'bridge'){
var attrCmd = MenuElement.create('command', 'Copy Attributes', 'at the end of Tools'); //create new menu command
}
attrCmd.onSelect = function(){
try{
var thumbs = app.document.selections;
var baseName = '';
var baseLen = 0;
var lbl = '';
var rtg = 0;
for(var i = 0; i < thumbs.length; i++){
if(thumbs[i].core.itemContent.canDoCameraRaw){
baseName = thumbs[i].name.split('.');
baseLen = baseName.length - 1;
if(baseName[baseLen].toLowerCase() != 'jpg' && baseName[baseLen].toLowerCase() != 'jpeg'){
baseName.length--;
baseName = baseName.join('.');
for(var j = 0; j < thumbs.length; j++){
if(thumbs[j].name.toLowerCase() == baseName.toLowerCase() + '.jpg' || thumbs[j].name.toLowerCase() == baseName.toLowerCase() + '.jpeg'){
lbl = thumbs[j].label;
rtg = thumbs[j].rating;
thumbs[i].label = lbl;
thumbs[i].rating = rtg;
break;
}
}
}
}
}
}
catch(e){
alert(e + ' ' + e.line);
}
}