I admire your optimism, but the manual valve (hydraulic) will override any signal from the inhibitor switch (electronic). If it were a selector cable fault, then the gear position indicator on the dash wouldn’t correspond with the selector lever position. Could be pretty much anything, knowing the 5L40-E’s reputation, but it does sound like a mechanical/hydraulic fault within the transmission running gear e.g. clutch plates welded together.
Personally, first I’d remove the sump pan and just check that this pin on the rooster comb is engaged with the manual valve and that the manual valve slides in and out of the valve body when the shift lever is moved from P to D and back again.
This would also provide an opportunity to check for metallic debris on the sump magnet, which may provide further evidence of a serious mechanical issue.
Phil