• I had this issue too, tried everything above but still got the error.

    Database was called clientdatabase and the log file clientdatabase_log.

    I managed to resolve it by renaming the logical name of the log file:
    USE [clientdatabase];
    ALTER DATABASE clientdatabase MODIFY FILE (NAME = clientdatabase_log, NEWNAME = clientdatabase_log_1);
    GO

    Re-running the original script for shrinking the transaction log (with new logical name) now worked.

    I blogged about it here:

    https://hybriddbablog.com/answer-to-could-not-locate-file-xxx_log-for-database-xxx-in-sys-database_files/