The source is on the official site of the belgian statistical office : https://statbel.fgov.be/fr
« À PROPOS DE STATBEL »,
« MÉTHODOLOGIE », « Classifications »,
« DÉCOUPAGES GÉOGRAPHIQUES »
Codes des parties de communes (NIS 6), Nomenclature à partir du 01/01/2025
There you get the file : https://statbel.fgov.be/sites/default/files/Over_Statbel_FR/Nomenclaturen/NIS6nwithnamefrom01012025.xlsx
This file gives you all the olds municipalities before the fusion of year 1977
You have the code of the old municipality on 6 characters (level 9 and for a few ones in Bruxelles-Capitale level 10) and the code of the new municipality they are included in on 5 characters (level 8)
So the difference between the code of entities with level 8 and level 9 or 10 is the length of the code.
Bruxelles-Capitale is a little peculiar becacause there is not a province between the region and the arrondissement.

The code 21004E is in this file.

They are 2691 old communes
When I began my mofdifications 1164 old communes had the right code (the code that is in the NIS6nwithnamefrom01012025.xlsx file)
In the others 1527 the code was either missing or wrong.

This information (ref:INS) is very usefull because if I start from the files of STATBEL, each municiplity or old munipality has a ref:INS code and with this code I can fin the municiplity or old munipality in OSM by the mean of the OQL API.

Please tell me if I haave answerd all your questions.