Hi @Temuujin, welcome to the community! Glad to hear you figured it out and sorry for the trouble you had in the first place!
Depending on your reasons for building a custom image you might perhaps find it easier to use an approach like this one shared by @dakota2gen:
This uses the n8n base image and just adds additional packages such as Python or npm modules. I find it much easier to maintain compared to the official approach (but it would not do the job if you need to change n8n itself, so this depends on your specific needs).