Web client session not being released after API call

SOLVED

Dear community

Does anyone know how to solve the problem where a RESTful API call, regardless of method (GET, POST, PUT), does not release the client session which then consumes a badge? I have tested this on multiple environments and versions and the problem occurs on all of them. In the example below I have used X4CLF to test which is linked to a developer badge but the problem is badge agnostic: