Python withPackages fails in devenv with poetry2nix

Hoes someone tried to use poetry2nix with devenv?
I have the following play project and it works fine.
However as soon as I try to use a Python version with some packages I get the following error but I don’t see where the self is coming from.

Project: sort-of-pastebin/flake.nix at main - sort-of-pastebin - Gitea: Git with a cup of tea

Code that breaks it

          env = mkPoetryEnv {
            projectDir = ./.;
            python = (pkgs.python312.withPackages (python-pkgs: [

Error message:

direnv: using flake . --impure
       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'devenv-shell'
         whose name attribute is located at /nix/store/cb1gs888vfqxawvc65q1dk6jzbayh3wz-source/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'DEVENV_PROFILE' of derivation 'devenv-shell'

         at «none»:0: (source not available)

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: function 'anonymous lambda' called with unexpected argument 'self'

       at /nix/store/cb1gs888vfqxawvc65q1dk6jzbayh3wz-source/pkgs/development/interpreters/python/wrapper.nix:1:1:

            1| { lib, stdenv, buildEnv, makeBinaryWrapper
             | ^