No, afterwards you explain that the severity of the situation made it so you had no choice to lie.
Its not even about the paper, a 5yo child should not be locking doors. Children are incredibly skilled at endangering themselves in creative ways and they may not be capable to open it after. You’re number one priority is to get it unlocked.
The adult should also learn their lesson here which is to not leave keys on any door and to place those important papers out of reach.
I get to be a lower deck starfleet commander in a post scarcity universe.
Thats even better then winning the lottery!!