Docker Zwave std::bad_alloc

Getting this error with docker when i enable zwave. Any ideas? have tried everything

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

Ubuntu Server
Docker
HA Version 51.1, 51.2, 52.1

EDIT: (SOLVED)
Well after trying everything I solved it.

First I disabled all components (same error)
Next I created another docker container (HA2) pointing to a blank config folder(config2) but enable zwave (it worked)
I then pointed HA2 to old config folder(config1) (same error)
I moved all yaml file and config to config2 folder (it worked)
Deleted config1
Renamed config2 config1
Started HA1 using renamed config2 (it worked)
I believe config folder had wrong permissions or something. It was not root user but I would expect it work anyway.