IndexOptimize is successful, but sys.dm_db_index_physical_stats still shows huge fragmentation
This is from Ola Hallengren's SQL Server Index and Statistics Maintenance documentation:


  MinNumberOfPages
  
  Set a size, in pages; indexes with fewer number of pages are skipped
  for index maintenance. The default is 1000 pages. This is based on
  Microsoft’s recommendation.
  
  IndexOptimize checks page_count in sys.dm_db_index_physical_stats to
  determine the size of the index.


Therefore, the indexes you mentioned are still fragmented after executing IndexOptimize were most likely skipped for having fewer pages than the minimum of 1000 pages since you didn't change that value in your code.