The reason cases like this happen is because they are 2 different reports:
1. The directory is a "Point in time" report which gives you the data as of TODAY
2. Headcount KPI - will always give you the data as of the END OF PERIOD you are looking at.
KPIs headcount takes into account ONLY the following lifecycle statuses (as for the end of each period):
Employed
Leave
Garden Leave
Parental Leave
Here is an example:
Today is 12/6. In the directory you see 87 EEs for all these statuses: Employed, Leave, Garden Leave, and Parental Leave

While in the KPI headcount report you see 89 (according to the last day at June):

The first thing we will want to check: are there any New Hires that will join in June:

So we have 4 new joiners with a future start date in June:

We now have:
*87 employees in status – Employed/Leave/Parental Leave/Garden Leave
*4 employees in status Hired that will be in status “Employed” at EOM
So the total is 91 employees, which still doesn’t match what we see under the KPI dashboard page.
At this point we will want to check if there are future terminations in June.We see we have 2 that will be terminated on 27/6:
So now our total is:
*87 employees in status – Employed/Leave/Parental Leave/GardenLeave
*4 employees in status Hired that will be in status “Employed” at EOM
*2 employees who will leave the company by EOM
So the total is 89 which is what we see on the KPI headcount😊
Advanced scenario:

Today is 12/6. I go to my headcount KPI report to see how many contractors we have in June?
I see 5 under headcount, after I filtered by “Employment type” = “Contractor” :

Then I go to Directory and filter by Employment Type "Contractor" but I see 4:

So I have 1 missing employee.
In order to understand this difference I will go to “Employment History” report:

Then I will filter by “Employment effective date” is in this month:

Then you will find one employee who is going to change the employment by EOM and that is Harry Potter:

You can also get to this conclusion by filtering by changes in employment this month:

Then you will get this result:

So back to the original scenario:

We have 4 contractors today in the directory and 1 future contractor by EOM so in total we have 5, just like we see in the Headcount KPI, as it always shows by the end of the period you are viewing which is now “This month”.