MSSQL Stored procedure custom paging stored procedure : I have a stored procedure like following:

    USE [db_Test]
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[zsp_GetUsersAdministratorPanel]
    (
    @StartRowIndex  int,
    @MaxRows		int,
    @OrderByField	nvarchar(200),
    @Asc			bit,
    @SearchValue	nvarchar(200)
    )AS
    BEGIN
    	-- SET NOCOUNT ON added to prevent extra result sets from
    	-- interfering with SELECT statements.
    	SET NOCOUNT ON;
    
    	DECLARE @UsersTable TABLE(UserId uniqueidentifier,
    				    FirstName nvarchar(400),
    				    LastName nvarchar(400),
    				    Email nvarchar(200))	
    
    	DECLARE @WhereQuery nvarchar(max)
    
    	SET @WhereQuery = ' WHERE '
    
    	IF LEN(@SearchValue) > 0
    		BEGIN
    				SET	@WhereQuery = @WhereQuery +
    				  'FirstName like ''%' + @SearchValue + '%''  or '
    				+ ' LastName like ''%' + @SearchValue + '%''  or '
    				+ ' Email like ''%' + @SearchValue + '%'''
    		END
    
    	DECLARE @OrderQuery nvarchar(max)
    
    	IF LEN(@OrderByField) > 0
    		BEGIN
    			IF @OrderByField = 'Email'
    				SET	@OrderQuery = ' ORDER BY Email ' +
    					CASE @Asc WHEN 1 
    					THEN ' ASC ' ELSE ' DESC ' END
    			ELSE IF @OrderByField = 'FirstName'
    				SET	@OrderQuery =
    					' ORDER BY FirstName ' +  
    					CASE @Asc WHEN 1 
    					THEN ' ASC ' ELSE ' DESC '  END
    			ELSE IF @OrderByField = 'LastName'	
    				SET	@OrderQuery = ' ORDER BY LastName ' +  
    					CASE @Asc WHEN 1 
    					THEN ' ASC ' ELSE ' DESC '  END		
    				
    		END	
    	
    	DECLARE @Query  NVARCHAR(MAX)
    	SET @Query = 'select UserId, 
    				FirstName,
    				LastName,
    				Email
    			from 
    			(
    
    	
    				SELECT 	ROW_NUMBER() OVER ('+ @OrderQuery +')
    					AS [ROW_NUMBER], 
    						[t0].[UserId], [t0].[FirstName], 
    						[t0].[LastName], 
    						[t0].[Email]
        					FROM [dbo].[Users] AS [t0]' +
    						@WhereQuery +
    			') AS [t1]' +
    			     + ' WHERE [ROW_NUMBER] BETWEEN 
    			     	@StartRowIndex AND @MaxRows' + @OrderQuery
    
    	PRINT @Query
    
    	INSERT INTO @UsersTable EXEC sp_Executesql @Query,
    					N'@OrderQuery nvarchar(max),
    				 	@StartRowIndex int,@MaxRows int',
    					@OrderQuery=@OrderQuery,
    					@StartRowIndex = @StartRowIndex,
    					@MaxRows = @MaxRows
    								
    	SELECT * FROM @UsersTable			
    
        SET NOCOUNT OFF;
    END

When I pass the following parameters:

StartRowIndex - 1
MaxRows(page size) - 50
OrderByField - FirstName
Asc - 1
SearchValue - Test

I'm getting a following error:

    select UserId, 
    				FirstName,
    				LastName,
    				Email
    			from 
    			(
    
    	
    				SELECT 	ROW_NUMBER() OVER ( ORDER BY FirstName  ASC )
    					AS [ROW_NUMBER], 
    						[t0].[UserId], [t0].[FirstName], 
    						[t0].[LastName], 
    						[t0].[Email]
        					FROM [dbo].[Users] AS [t0] WHERE FirstName like '%test%'  or  LastName like '%test%'  or  Email like '%test%') AS [t1] WHERE [ROW_NUMBER] BETWEEN 
    			     	@StartRowIndex AND @MaxRows ORDER BY FirstName  ASC 
    Msg 206, Level 16, State 2, Line 4
    Operand type clash: int is incompatible with uniqueidentifier
    
    (1 row(s) affected)


I'm not quite sure what is causing the error here... I'm trying to create a stored procedure which would go through my Users test table which will have a large amount of data (500000 users later on), so I'm trying to ensure smooth user experience.

Why am I getting this error?

Can someone help me out?