Nixos-shell with flake seem to ignore my configuration file

I try to test nixos configurations using nixos-shell.
My configuration is a flake.
I am not sure if the example works: nixos-shell --flake github:Mic92/nixos-shell#vm-forward

Using a relative path
nixos-shell --flake .#mylaptop
fails with
...No such file or directory

using the git (private) repository starts a vm but without the configuration I prepared:
nixos-shell --flake github:me/dotfiles#mylaptop
It also claimes that system.stateVersion would be missing which shouldn’t be the case
trace: warning: system.stateVersion is not set, defaulting to 22.05. Read why this matters on

Do flakes work with nixos-shell?