I have implemented force:hasRecordId and I was able to console log the case id can you check the code I used once:
Component:
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,flexipage:availableForAllPageTypes" access="global" >
<aura:handler event="lightning:tabClosed" action="{! c.onTabClosed }"/>
Case Id is {!v.recordId}
</aura:component>
Controller:
({
onTabClosed : function(component, event, helper) {
var caseId= component.get("v.recordId")
var tabId = event.getParam('tabId');
console.log("Tab closed: " +tabId);
console.log("Case Id:" + caseId);
}
})