Again, you can only interact with Minecraft from the main thread. You said you fixed this, when in fact no, you did not fix this.
You say command, is this a server side command? In that case you cannot just open a GUI from there, that is known as reaching across logical sides. It will cause strange problems like the one you are experiencing and crash outright when run on a dedicated server.
If you want to open a GUI from a server-side command you must send a packet.

Hi there,
I'm updating an old mod that used metadata for different textures even though each 'metadata' gave the block different properties.
I'm aware of the RegistryEvent.MissingMappings<T> event but is there a way to remapIBlockStates?
Examples:
utilsBlocks:stone_block, metadata:1 -> utility_blocks:carved_stone_bricks#age=old
utilsBlocks:stone_block, metadata:2 -> utility_blocks:stone_path#normal