It's normal that on the first click nothing happens, because it's on the first click that you are setting the popover, once set (in the first click) the popover will show in the next clicks,
if you want it to show on the first click you should set the popover when jquery is ready :
$( document ).ready(function() {
switch(dataCheckTrecut[1]) {
case '02':
var luna = "Februarie";
break;
}
$(".checkRezolvataTrecut").popover({
placement: "top",
content: "<button class='btn btn-default mutaTrecut' style='width: 100px;'>" + luna + "</button><button class='btn btn-default mutaCurent' style='width: 100px;'>Luna curenta</button>",
html: true
});
});