Both the door and trapdoor are blocks which are three pixels thick. It is possible to place a door on top of a closed top-half trapdoor. When said trapdoor is opened, the door will pop off, which makes sense in most cases, as the door block simply cannot exist without support. However, the door will still pop off even if said trapdoor is aligned to the same block face as the door, which would mean it has just enough space to support it. One would expect the door to not pop off in this case, and also be placeable.
For similar reasons, it is not possible to place doors on top of other doors.
Was able to re-create this on Minecraft 19w14b.