Seem to be having an issue with the onClose event not firing when calling the close function manually.
Calling the popup
$('#messageBoxPopup').bPopup({
easing: 'easeOutBack',
speed: 450,
onClose: function () {
alert('clear');
$('#messageBoxContent').html('');
}
});
Closing the popup
$('#messageBoxPopup').bPopup().close();
working fine for me please check for all js dependencies for bpopup