I tried the whitelisted mech. This does not work for offline players.
It saves their UUID in the whitelist but no name. This makes the player not whitelisted.
I tried using this:
ex foreach <server.players> { - adjust <player> whitelisted:true }
I used this as alternative:
ex foreach <server.players> { - execute as_server "whitelist add <[value].name>" }
Probably a bug with Mojang's whitelist but maybe we can compensate for this?