I feel like I'm playing a different game from some people here.Warning regarding AI: The Somnium Files 2 - controllers do not work if you're running Windows 11 (I personally tested this with DirectInput and Xinput pads, neither work).
Per the game's own Steam discussion forum, it appears to be some kind of conflict with the Steam overlay, and affects both Somnium Files 1 and 2. Spike Chunsoft is aware of the issue and are supposedly working on a fix. But for now, if you're planning on playing using a pad, you should hold off on picking up the Steam version.
It worked perfectly fine using my Xbox One Elite controller in Windows 11. Plus I've had no issues playing this game on Steam Deck.
Edit: For what it's worth, I have SteamInput disabled for all my controllers except the Steam Controller, so maybe that's the solution? If you have SteamInput enabled generally, maybe try disabling it for this game?