So the final TL;DR answer is: this feature is not going to be implemented, because of poor quality and buggy highly valued, NDAed intellectual property called firmware in laptops.
According to this thread on Linux kernel bug tracker, in way too many laptops firmware initializes its internal lid state variable to zero on boot - meaning "closed", even though you cannot turn the laptop on with the lid closed (this is checked by firmware before power-on).
For this reason kernel and therefore userspace can rely only upon changes in state after the device is booted and assume it's open unless proven otherwise.
Root users can check the kernel state directly by calling the appropriate input device, the C code is simple, but you can still use existing utility called "evtest" as shown in the answer by Stuart P. Bentley:
# evtest --query /dev/input/EVENT_N EV_SW SW_LID && echo open || echo closed
Normal users can call systemd's logind over D-Bus (since v240):
dbus-send --system --print-reply=literal \
--dest=org.freedesktop.login1 /org/freedesktop/login1 \
org.freedesktop.DBus.Properties.Get \
string:org.freedesktop.login1.Manager string:LidClosed | \
awk 'NR==1{print $3=="true"?"closed":"open"}'
or
busctl get-property org.freedesktop.login1 /org/freedesktop/login1 \
org.freedesktop.login1.Manager LidClosed | \
awk 'NR==1{print $2=="true"?"closed":"open"}'