It's a big bad BUG on the latest versions of obs. in my system (high end rog pc) no sound is recorded from line in source. Sound is playing normally even through obs monitor but no sound in the recorded file... You can see that there is no sound on the properties of the recorded mkv, usually there is no audio bitrate shown, or sometimes it's 2 (!). Audacity records just fine, and also any other recording program i tested, so it's not pc's fault. I hope they fix it fast.
Workaraund: You can unhide/enable Desktop Audio (in the audio sources, and unmute it. So when i do this, desktop audio has exactly the same sound as my line in, and then miraculously, audio is recorded.