You may find it easier to get an external USB optical drive which you can connect directly to this laptop.
FYI, newer versions of macOS may not be able to read the contents of some older drives depending on the format the disks/discs used. I believe macOS 10.15 Catalina may have been the OS which dropped support for some older file systems (or Catalina may be the last OS able to read the older file systems).
Another potential issue is that the discs you are trying to access are not readable anymore even with the proper hardware & OS setup. CDs & DVDs can degrade over time....especially discs which were "burned".....factory made discs should hold up a bit better, but some of them were poorly made too. And the optical drive may be dirty or the laser may have weakened over time.
You will want to make sure you can access a CD/DVD on the other computer before attempting to access that shared drive remotely. If the local computer with the built-in optical drive is unable to read the disc, then your remote computer won't have any chance either.