I ran into the same issue and found a workaround that shouldn't have any clear drawbacks (if I'm forgetting something, please correct me). It's based on Solomons answer, but without the need to specify the absolute path to the database files directly.
DECLARE @databaseName NVARCHAR(MAX) = 'MyDatabase'
DECLARE @dataFilePath NVARCHAR(MAX) = CAST(SERVERPROPERTY('InstanceDefaultDataPath') AS NVARCHAR)
+ FORMATMESSAGE('\%s.mdf', @databaseName)
DECLARE @sql NVARCHAR(MAX) = FORMATMESSAGE(
'CREATE DATABASE %s ON PRIMARY ( NAME = %s, FILENAME = ''%s'' )',
quotename(@databaseName), quotename(@databaseName), @dataFilePath)
)
EXEC (@sql)
It uses dynamic sql and is not exactly pretty, but it gets the job done until there is an official fix to the issue.