Thanks for reporting @kfeina.
This actually is caused by the same underlying issue as the other problem you reported.
Therefore, the fix for that issue, also addresses this one. For example testing this with v100.2.2 of the data entry app on DHIS 2 Demo - Sierra Leone, you should now see an error when the code is of an invalid type: