Use another disk for "optimize table" temporary file
If you have deleted most of the rows from a table, OPTIMIZE table needs only enough room to build a new, smaller, copy.  After the copy is finished, it will rename, then drop the old table.

If the table had its own tablespace (built with innodb_file_per_table=ON), then the freed space will be returned to the OS.  But...  The 17GB free in the .ibd cannot be used for the table copy.  The copy will be in a separate file.  So it could fail if the resulting table is more than 8GB (data+index).

If =OFF, the OPTIMIZE will try to use free space in ibdata1 before increasing the size of that file.

There is 17GB free somewhere; I can't tell where.

Also, check TABLE STATUS for other tables.  The Data_free for all tables in ibdata1 will be the same value.  What is that value?

There are tricks to work around the cramped space, but I need answers to the questions posed.