The inquest into the death of a teenager after an intense relationship with her teacher has exposed a loophole in a new law designed to protect vulnerable children.