I get an insufficient storage space error when trying to download an app and I have several gigabytes of free space
Apps don't necessarily install on an external SD card. Normally, they would install on the system memory and then, if capable, the app can be "moved" to the SD card. Moving still leaves part of the app on the phone memory and usually increases the overall size of the app.

Long story short- make sure you have room on your device's internal memory to install apps.