There are two different questions here
Fails: tablet - Samsung adapter - extension-cable - OTG-device..... (But) it works when inserted between a thumbdrive and a PC
Android devices support USB host mode ( connecting a USB keyboard or mouse ) as well as USB peripheral mode ( example you can plug it into a PC, so the PC can access the phone's storage)
USB OTG cable facilitates the connected device to work in host mode
PCs always run in host mode
Source: What is the difference between USB On-The-Go (OTG) and USB Host Mode?
So when you connect using an extension cable to a PC, there is no issue in detection by PC which is always in host mode.
Now, coming to the bit of why extension cable breaks OTG
From an electrical perspective, which is well explained here
To avoid potential conflicts regarding which device is host and which is peripheral, the assignment of which device is A or B is determined by the orientation of the OTG cable. This cable determines whether the signaling pin of the port it is plugged into is left floating or is pulled to ground. The device with the signaling pin pulled to ground is designated the A-Device, or default host, and the device with the floating signaling pin is designated the B-Device, or default peripheral.
By adding a USB-A male-female 4-lead extension cable to the OTG cable, you are not extending this port detection mechanism to the other end. Hence it fails detect connected device
Ii is better to shop for a longer 3 metre OTG cable instead of attempting to increase the length as experimented
Charging worked, but the tablet wouldn't recognize OTG devices
As explained in Powering a Nexus 7 tablet through the USB port while simultaneously connecting a USB device :
.... While you can purchase various kind of “OTG” Y-cables, which purportedly will allow you to use an external device (or even connect to a USB hub so you can use multiple devices) while at the same time allowing a charger/power supply to be connected, this doesn’t work with a stock Nexus 7.
This is a kernel limitation and you can override that by rooting and flashing a custom kernel as explained in the linked article
USB on the go standards
From SE Electronics: Can an Android tablet serve as USB Host and be charged simultaneously through a single port?